If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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).

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.

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.