How to upload hard coded image in php
I want to upload a particular image without using upload controls. My problem is that I am not able to pass the hard coded image path to upload.php
.
upload.php:
<?php
//i want to assign my image path here can any one tell me how to do that
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
开发者_StackOverflow社区?>
When you post a file, it get's uploaded to a temp folder wich is somewhere in your server. It depends on your server configuration. If it is a shared server, the temp folder might be shared with other users as well. What you need to do is use the php function move_uploaded_file($temp_file, $destination)
to copy it to the new path. If you don't do this, the temp file will get eventually deleted.
精彩评论