Search the Community
Showing results for tags 'upload file'.
-
Hi there, Can you help me with the script 19.2. please? The problem is that though I uploaded the size-allowed image to uploads folder, which is in the same directory as add_print.php file, but it failed and the error message says 'No file was uploaded.' . You can test it here (http://hiteachers.com/add_print.php) Note: As the uploads folder is on the same level as the add_print.php, and I don't create the admin folder either, I change the paths for $temp from '../../uploads/' . md5($_FILES['image']['name']); to $temp = './uploads/' . md5($_FILES['image']['name']); and for rename from ($temp, "../../uploads/$id"); to rename ($temp, "./uploads/$id"); Is it the cause of the problem or what else? Thanks for your help in advance. Regards, Ericp
-
Hi, Regarding script 13.3, which is the more reliable way of confirming a file’s type using the Fileinfo extension. I understood. However, the example script 13.3 I could see shows that the codes (... if (finfo_file($fileinfo, $_FILES['upload']['tmp_name']) == 'text/rtf') {...) only check and validate only one type of file, called .rtf. Is there other ways that we can validate multible types of file using the Fileinfo extention, e.g., .jpg, .gif, .docx, ect? Thanks
-
script 11.4 pg. 310, upload_file.php I've copied and pasted the code downloaded from the ullman site for this 4th edition. I've run the code in netbeans 7.0 and it returns a Object Not found Error 404. The uploads folder is created in the level directly above the directory where the upload_file.php is located. Here is my php apache install: Apache/2.2.17 (Win32) PHP/5.3.5. OS: XP pro sp 3. All the code up to this script has performed flawlessly. Perhaps you know why this Object Not Found message is occurring.