943,948 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 584
  • PHP RSS
Feb 23rd, 2009
0

Upload files

Expand Post »
I have a PHP (version 5) site on a Windows server that allows uploading of files into our Windows server. I currently allow the user to upload up to 10 files at once. If users upload files as big as 20 mb or more slows the upload process down. Should I just allow one file upload at a time for better performance? I was wondering how other PHP developers handle this?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
chicago1985 is offline Offline
36 posts
since Nov 2007
Feb 23rd, 2009
0

Re: Upload files

This is one of the weaknesses of php. You can not use php to check the file size until AFTER the file/image has been SUCCESSFULLY uploaded to the server.

You also can not use javascript to access the client side file system. This is an area where i see Adobe Flash upload scripts really fill the gap. As they tend to be able to check the size of the file prior to the upload occurring.

I'd suggest looking into some of the many flash upload scripts that exist and how to tie them into php, unless someone else has a more controlled solution.
Sponsor
Reputation Points: 265
Solved Threads: 126
Practically a Master Poster
mschroeder is offline Offline
624 posts
since Jul 2008
Feb 24th, 2009
0

Re: Upload files

I first display a message to the user letting them know the maximum size of files they can upload (post_max_size), then I use a flash upload script to subtract from that number for each file they choose to upload. When they run out of space, I disable the browse files button.

I wish I still had the link for the flash script I am using. If I can track down the original source I will post it here.
Reputation Points: 10
Solved Threads: 0
Light Poster
david.1982 is offline Offline
28 posts
since Mar 2008
Feb 24th, 2009
0

Re: Upload files

are you uploading to a folder tricky question to answer you could try making a loop to upload one at time make the submit page call to itself until the files value return a false value then exit but this will still take the same amount of time i would of thought. That is how i handle my news letters when emailing them to alot of people
Reputation Points: 10
Solved Threads: 0
Junior Poster
shadiadiph is offline Offline
117 posts
since Apr 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: fsockopen()
Next Thread in PHP Forum Timeline: Getting start with MySQL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC