0

I have a form that submits a picture, screenshot is the name of the input tag.

In the php script I can print out $_FILES['screenshot']['name'], but when I try to get the temp folder it is saved in on the server with $_FILES['screenshot']['tmp_name'], I get nothing.

Anyone know why? Seems like the file gets to the temp folder, but I can't get the path.

1 Answer 1

2

They're stored in /tmp and removed on script completion as far as I remember..

You need to use move_uploaded_file to move the file to an accessible folder..

I.E.

move_uploaded_file($_FILES['screenshot']['tmp_name'], '/uploads/' . $_FILES['screenshot']['name']);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.