View Full Version : when i upload a big file in mini file host it tells me You didn't pick a file to uplo
MAXiMOS
03-26-2009, 08:30 AM
Hello!
I've a probleme when i upload a big file for ex 2mo
it tells me You didn't pick a file to upload
and in the Settings the Max File Size: 50mo
how can i fix this problem
Good Bye Blue Sky
felgall
03-26-2009, 12:30 PM
By "in the settings" do you mean the php.ini file on the server? That file specifies the overall maximum file size allowed. HTTP becomes progressively less efficient than FTP once file sizes go over 1Mb so the default is usually set to 2Mb since files bigger than that really ought to be uploaded with FTP.
wysiwyg
03-26-2009, 05:10 PM
I wrote a script to test this. For downloads, HTTP and FTP were roughly the same speed, although FTP was significantly (up to 300%) slower for small files (<1mb).
Testing upload speed for $_POST in php is actually impossible, as far as I can tell. The script isn't executed until the file is already on the server. It would have to be measured client-side via javascript or something.
Anyway, more effort than I was willing to put into it. I doubt the upload ratio is any different than the download.
felgall
03-26-2009, 07:14 PM
I doubt the upload ratio is any different than the download.
That is the main difference between HTTP and FTP - HTTP is specifically optimised for DOWNLOADing web pages and uploading of small requests (100 chars or less in most cases) to identify what page to download next - priority is therefore given to downloading and uploads take way way longer. FTP on the other hand is optimised for file transfer and uses separate chanels for the requests and the data.
If there were not a difference in upload speed between the two protocols then two separate protocols would not be required as then the two would be effectively identical.
Also your test for download speed only shows that they run the same when uploads are not trying to happen at the same time. If you were trying to upload and download files at the same time then the two directions would get equal priority with FTP but the uploads would wwait for the downloads to finish with HTTP.
wysiwyg
03-26-2009, 08:20 PM
If there were not a difference in upload speed between the two protocols then two separate protocols would not be required as then the two would be effectively identical.
Transferring at the same speed does not make them identical, and it wouldn't make one of them obsolete.
We don't have different protocols because they can transfer data at different speeds. We have different protocols because they provide a standard set of rules on how to handle requests.
HTTP wasn't designed explicitly for transferring arbitrary files, but it has methods to do so (yeah, built-in), and any speed difference is negligible compared to FTP.
Expecting visitors to have and use an FTP program just to upload files to your server is absurd. Name one major site that allows users to create an FTP account for uploads, let alone force them to. Not even file sharing sites use FTP.
Aside from that, you can't impose the necessary restrictions on content uploaded by an FTP client. The closest you could come is isolating the FTP directory and periodically (excessive use of resources) scan the directory with a script to check for new files to analyze and move to the correct location (which, I'm not even sure how you'd determine).
FTP was designed purely for transferring files. HTTP has upload capabilities. So why would visitors to a website use FTP?
felgall
03-26-2009, 11:57 PM
So why would visitors to a website use FTP?
Because HTTP always gives priority to downloads and so uploads are always slowed down if the site is also serving web pages at the same time since the web pages get the biggest slice of the HTTP bandwidth. If you can use FTP it will therefore run much faster because FTP does not have a directional bias built into it for sending and receiving data the way HTTP does.
The whole reason why upload file size limits default to 2Mb is because files bigger than that generally upload much more slowly with HTTP than if they used a protocol intended for transferring files. The only reason why HTTP gets used despite its not being intended for the task is that it is far easier to set up and for small files the differences are negligible.
wysiwyg
03-27-2009, 07:57 AM
PHP's default 2mb file size limit is not because bigger files are slower, it's deliberately low because most websites don't need it to be higher, and having a limit prevents abuse of bandwidth and space. I'm sure bluehost would love it if nobody could upload files bigger than 2mb.
While we're on the topic of defaults, I should mention post_max_size, by default, has a limit of 8mb, which would allow you to upload four 2mb files at the same time, with the same form.
But it doesn't really matter what PHP's default limit is, it's just a default, they're factory settings (perl's is over 32mb). How many things do you own that you leave the default settings on? Apache wouldn't make a very good web server on its default settings, considering nobody could connect to it.
If it were of great concern that people were using web servers to upload files then apache would have a default limit built into it, not the languages, in fact there would probably be a hard cap built into the protocol.
Anyway, if HTTP traffic had as much impact on the server as you're making it out to be, then sites like megaupload and rapidshare couldn't exist. They support thousands of concurrent large file transfers, they do it over HTTP, and they do it very quickly.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.