- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
This has been a real hazzle. What’s wrong with my code?
EDIT: the code messed up here so I pasted it on pastebin: http://pastebin.com/4KZUeizj
What error do you get here?
Is the directory where you are uploading to got the correct permissions?
What error do you get here?
this is the HTML:
<input type="file" name="file" accept="image/*" />
…is there a form
associated with this input? what is the value of its enctype
attribute?
//now is the time to modify the future file name and validate the file
Note that you don’t actually validate anything about the file, other than its size. This is a severe security risk. For example, if you want an image, you should make sure you got an image and not an executable script (especially if you plan on saving it somewhere accessible via the web).
move_uploaded_file($_FILES['file']['tmp_name'], '/images/'.$new_file_name);
You have a directory named images/
in your server’s root directory?? or is this meant to be a relative filepath?