Jump to content

[Solved]Fileupload


Sami

Recommended Posts

PHP is case-sensitive. There is no $_files array. There is a $_FILES array. To debug that, try var_dump($_FILES) at the top of your script.Where is the script with the go() function?

Link to comment
Share on other sites

I did replace the $_files whit upper case, but it didn't work, and the "var_dump" came up whit this:

array(1) {  ["file"]=>  array(5) {	["name"]=>	string(33) "Alice Deejay-Better off alone.mp3"	["type"]=>	string(0) ""	["tmp_name"]=>	string(0) ""	["error"]=>	int(1)	["size"]=>	int(0)  }}

And the go() function? I'm not using AJAX right now.

Link to comment
Share on other sites

Oh man, I haven't heard that song in freaking years. I'm not sure I miss it.

Link to comment
Share on other sites

For some reason, your file is not uploading completely.mp3 files can be big. If your upload exceeds the upload_max_filesize value set in your php.ini file, the file will not completely upload. You will get only a filename and no other data.If you execute the phpinfo() function (try this in a separate document) you will get a report that includes your current ini settings. Scroll down until you find upload_max_filesize. If it is smaller than the files you want to upload, you'll need to adjust the maximum in your php.ini file. If the server is not yours (if your site hosted) and you do not have such a file, try creating one in your root directory. That directory is probably the directory ABOVE your homepage directory. Simply add a line like this:upload_max_filesize = 20MOr whatever value seems correct for your application. Note that your host may not allow you to override this setting (or any ini settings). Different hosts have different rules. Sometimes if you email your host admins you can request this permission.

Link to comment
Share on other sites

In php.ini, I've found:✖ post_max_size = 8M✓ file_uploads = OnAnd "M" means MegaBytes? Than 1000 should be enough...

Link to comment
Share on other sites

According to your output in post 3, the error code is 1. If you look at this page:http://www.php.net/manual/en/features.file-upload.errors.phpthat says that an error code of 1 means that the file was larger than the upload_max_filesize directive in php.ini. It will help you in your PHP script to check the error code for each file that was uploaded and print out the associated error message. An error code of 0 means there was no error.

Link to comment
Share on other sites

According to your output in post 3, the error code is 1. If you look at this page:http://www.php.net/manual/en/features.file-upload.errors.phpthat says that an error code of 1 means that the file was larger than the upload_max_filesize directive in php.ini. It will help you in your PHP script to check the error code for each file that was uploaded and print out the associated error message. An error code of 0 means there was no error.
Yes, I forgot to restart Apache :)Thank you for your help, Deirdre's Dad and justsomeguy!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...