I can't upload my file with this PHP script. Why? Please help.
Ok, I'm bested. I found (and tailored) this PHP code to upload files I a specific location. It works for most files (JPGs, GIFs, TXTs), but I need it to upload mp4s. Whenever I do, it runs for a while, then throws an error. I think the file is getting half-uploaded, but not showing in my FTP (using WinSCP).
I am not sure if there is a problem with the code or whatever, but it seems to execute the code just fine and finishes, but it gives me an error and doesn't display any text. The file also doesn't show in FTP.
post_max_size - (Total size of uploads, should be alright there too)
memory_limit - (This could be it, could be running out of memory, but if you have show errors and error_reporting(E_ALL) that would show)
max_execution_time - (Could be timing out, if that's the case, set_time_limit(0); should take care of that).
And the last one, use set_time_limit(0); on the page itself.
However, if you are on a shared server changing those values via .htaccess can be blocked. If that's the case you would have to contact your hosting provider. If that's not the case and its your server you could also edit httpd.conf.
Ok, I'm taking a slightly different approach. I made a php.ini file for the directory. This should fix it. I added these variables, and I'm trying to upload a 12MB file.
After uploading (or attempting to upload), my script gives an error. Specifically, the $_FILES["file"]["error"] generates 2, meaning the file I'm uploading is larger than the allowed file size. Are there other variables I have to set?
Hmm... I don't quite understand. Are you saying I should put an .htaccess file in my directory with these variables?
multimediocrity, if you're going to ask the same questions in 2 threads, at least read them both. This was already answered in the other one.
Shorts, don't forget when telling people to upload .htaccess file, they are not always visible by default in all ftp clients and file managers. If you create one and just upload it you may overwrite an existing file without knowing it.
Anti Linux rants are usually the result of a lack of Linux experience, while anti Windows rants are usually a result of a lot of Windows experience.
Good point. So used to utilizing .htaccess with FileZilla and ssh.
From my guess though, those settings probably won't be able to be changed anyways. Would surmise that this is a shared server and changing those values is blocked.
Bookmarks