954,124 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Issues w/ file uploads in PHP

I have a client who's attempting to support a file upload script on several servers. All appear to have PHP configured with file_upload turned on, however *some* act as if it's not. This is an area I've not got a lot of experience in (yet) ... Any hints on what other configuration or environmental differences might cause file uploads not to work for a specific server/instance of PHP?

Many thanks,

Leo

Leo
Newbie Poster
5 posts since Jun 2004
Reputation Points: 10
Solved Threads: 1
 

The directory you're uploading to has to have the appropriate security attributes. The most important is the -w attribute. A directory that I use, in one app I created, has the following: drwxrwxr-x - it's used for uploading stuff to.

samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
 

Thank you ... I've passed that along and we'll see if that's perhaps another part of our puzzle.

Leo

Leo
Newbie Poster
5 posts since Jun 2004
Reputation Points: 10
Solved Threads: 1
 

You also may want to check your MAX_FILE_UPLOAD size in your php.ini file.

Arizona Web
Junior Poster
118 posts since Jun 2004
Reputation Points: 16
Solved Threads: 2
 

depending on your host you might have to copy and paste the php.ini file into the folder where you upload script is being executed of course with the before mentioned

Dsiembab
Junior Poster
156 posts since Mar 2007
Reputation Points: 18
Solved Threads: 2
 

Yeh I had this problem, it's most likely as Arizona Web said with the MAX_FILE_UPLOAD in the php.ini since you said some files do upload.

I think by default it is configured to accept 2MB or less.

scru
Posting Virtuoso
1,629 posts since Feb 2007
Reputation Points: 975
Solved Threads: 140
 
depending on your host you might have to copy and paste the php.ini file into the folder where you upload script is being executed of course with the before mentioned


I meant change the php.ini MAX_FILE_SIZE for uploads in the copy. You can do this in any folder, depending on your hosting.

Dsiembab
Junior Poster
156 posts since Mar 2007
Reputation Points: 18
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You