vanyok Posted December 12, 2006 Share Posted December 12, 2006 hey, good morning.I have a simple script that uploads the file but I cannot get it to work.. says that " No such file or directory" even though the folder is there and i have CHMOD set to full rights.This is the form:<form enctype="multipart/form-data" method="post" action="ProfileResults.php"><input type="hidden" name="MAX_FILE_SIZE" value="3000"><input type="file" name="picture" size="30"><input type="submit" name="imageSubmit" value="Upload"></form>and here is the upload php file: if ($picture != "") { $path="/pictures/$picture.jpg"; copy($picture, $path) or die("Couldn't Upload the file!"); } else die("Please go back and select a picture to upload");What's wrong ? Link to comment Share on other sites More sharing options...
justsomeguy Posted December 12, 2006 Share Posted December 12, 2006 Check some of the examples here:http://www.php.net/manual/en/features.file-upload.phpYou will need to use the $_FILES array to access the file, and the move_uploaded_file function to move it where you want. Link to comment Share on other sites More sharing options...
djkadir Posted December 14, 2006 Share Posted December 14, 2006 $path="/pictures/$picture.jpg"; is wrong $path="/pictures/"."$picture.jpg"; is true but you must give permission from your ftp directory or your web site control panel. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now