file-access

PHP code to restrict member access by permissions

Hi, I am building a website in PHP & mySQL. It has frontend and backend capabilities. Only admin can enter the backend by means of username and password. Now if the admin wants to add other sub-admins to the website, he could do so. By this method, a sub-admin will be able to login and perform all actions that the original admin is able ...

How to check if a file has access denied and how to give rights(777) to a file in php?

I am working in php on ubuntu. When I use any image on web page which has denied access, there is warning on page. I want to check it before displaying and if it does not have rights to open then give it access to open. As we do in terminal command. chmod 777 myimage.jpg How to check this and give full access to a file in php. Thanks...

UnauthorizedAccessException on newly created files

I have an application that is looking through some files for old data. In order to make sure we don't corrupt good projects, I'm copying the files to a temporary location. Some of the directories I'm checking are source-code directories, and they have .svn folders. We use Subversion to manage our code. Once I've searched through all of ...

Python Creating Unwanted Folder in Directory..

Python is creating a folder in my directory every time I call this method. The method is in one of my Django applications that requires access to the server's local area. def filepath(filename, foldername='', envar='MYAPPDIR'): if envar is not None and envar is os.environ: dirpath = os.environ[envar] else: dirp...

How do I lock access to a file when a user has it open?

I'm writing a C#.NET program which uses XmlSerializer to serialize and deserialize the project the current user is working on to and from an XML file. This is working fine, but I'm trying to figure out a way to prevent two users from opening the same file off a network drive and having one user overwrite the previous user's save. I essen...

How to intercept the access to a file in a .NET Program

I need to intercept when the system tries to access to a file, and do something before it happens. ...

How to enforce READ_ONCE_ONLY built-in control for a file?

How to control access to a file in hard drive so that it can be read once only. After the first access, the file should be rendered inaccessible. ...

How to use Wordpress' http.php in external projects?

Answer : Implemented using Curl... $file = "http://abc.com/data//output.txt"; $ch = curl_init($file); $fp = @fopen("out.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); $file = "out.txt"; $fp = fopen($file, "r"); I am trying to parse data from a pipe-de...

Help securing files access with htaccess and php?

I'm working on a site that allows users to purchase digital content and have implemented a method that attempts to serve secure downloads. I'm using CodeIgniter to force downloads like this: $file = file_get_contents($path); force_download("my_file_name.zip", $file); Of course, I make sure the user has access to the file using a dat...

What is the simplest way to download file in PHP

Hi all, I need to download an image from some URL to my server. However, my server's config disallowed me to do it this way: getimagesize( $file ); Because, it generate error: Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in somefile.php on line 10 So, is there another wa...

Restrict file access from PHP -> Java Applet

I'm writing a portal in PHP that allows users to upload DICOM images, and allow users of the same group to view those DICOM images through a Java Applet. The html code to display images through the viewer looks like this: <APPLET archive=radscaper.jar codebase=./ code=com.divinev.radscaper.Main.class width=100% height=100%> <PARAM NAME=...

Multiple file access in groovy(Groovy on Grails)

Hello, I have an application that allows multiple users to access 1 xml file. The problem is that when all the users save at once the other changes by other users does not get saved. How do I detect if the file is in user in groovy? Thanks! ...

Read file as its being uploaded

By default you cannot access a file that is uploaded until it has been fully transferred to the server. What is the best way to get round this and be able to access the 'byte stream' as the file upload is in progress? ...

What ASP.NET Web Config entries could limit certain file access by date and time?

What entries in a web.config could allow certain files to become publicly accessible after a certain date and time? Specifically, we have these files starting with AB_.jpg where the _ could be anything. We put them in a folder on April 27th for example, but they shouldn't be accessible until April 30th at 11:59:59 PM. I think the web....

How to access files in interior of an iPhone App?

Hi everyone! I need in a iPhone app to access files that the app is build with(.plist etc). There's an hardcoded way to do this: NSString *appDir = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByDeletingLastPathComponent] ...

Joomla template parameters and params.ini - file becomes unwritable after save.

I am using wamp on Win XP SP3 and creating a Joomla template with changeable parameters. initially the message is The parameter file \templates\ssc_2010\params.ini is writable! once I make changes everything works as expected, except now i get the message: The parameter file \templates\ssc_2010\params.ini is unwritable! ...

Batch backup a harddrive without modifying access times C#

I'm trying to write a simple program that will backup my flash drive. I want it to work automatically and silently in the background, and I also want it to be as quick as possible. The thing is, resetting all the access times is useless to me, and something I want to avoid. I know I can read the access times and set them back, but I bet ...

How can I allow only privledged users to download a pdf with php?

Lets say I have some pdf files stored on my server and I only want to allow a person who's paid have access to download a particular pdf. So for an example, let's say I have a bunch of e-books. The only way a user would be able to download e-book A is if his account contains the right credentials for that particular book. What's the b...

How do I create a file AND any folders, if the folders don't exist?

Hi folks, imagine i wish to create (or overwrite) the following file :- C:\Temp\Bar\Foo\Test.txt Using the File.Create(..) method, this can do it. BUT, if i don't have either one of the following folders (from that example path, above) Temp Bar Foo then i get an DirectoryNotFoundException thrown. So .. given a path, how can we re...

Weird COBOL error

First of all, here's the full source code: http://pastebin.com/5teGNrPC I'm getting a weird COBOL Error, and I couldn't find what it means. It says Open Error (see the following screenshot: ) (full size at http://img251.imageshack.us/img251/623/screenshotyj.png ) It doesn't occur if I first use "new file", and add a record after that...