Upload file - how to detect wrong input
Posted: Wed Jul 01, 2009 12:22 pm
Hi,
I am working uploading feature with php and come to my mind of wondering what if user choose to input something like below
C:\php\extras\
And when click submit to next page, you will see the error message below. So the question is how to solve this kind of issue from happening. My idea is to use javascript to detect the value..but i am looking on other alternative.
Warning: move_uploaded_file(image_upload/extras") [function.move-uploaded-file]: failed to open stream: Invalid argument in D:\10 Document\Personal\www\www_04\t4.php on line 7
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php36.tmp' to 'image_upload/extras"' in D:\10 Document\Personal\www\www_04\t4.php on line 7
array(5) { ["name"]=> string(7) "extras"" ["type"]=> string(24) "application/octet-stream" ["tmp_name"]=> string(25) "C:\WINDOWS\Temp\php36.tmp" ["error"]=> int(0) ["size"]=> int(0) }
I am working uploading feature with php and come to my mind of wondering what if user choose to input something like below
C:\php\extras\
And when click submit to next page, you will see the error message below. So the question is how to solve this kind of issue from happening. My idea is to use javascript to detect the value..but i am looking on other alternative.
Warning: move_uploaded_file(image_upload/extras") [function.move-uploaded-file]: failed to open stream: Invalid argument in D:\10 Document\Personal\www\www_04\t4.php on line 7
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php36.tmp' to 'image_upload/extras"' in D:\10 Document\Personal\www\www_04\t4.php on line 7
array(5) { ["name"]=> string(7) "extras"" ["type"]=> string(24) "application/octet-stream" ["tmp_name"]=> string(25) "C:\WINDOWS\Temp\php36.tmp" ["error"]=> int(0) ["size"]=> int(0) }