File Upload Using Query String in PHP
-
Hello, I want to have such a specific PHP script, which I will use only for a special purpose, not for hacking or anything bad or illegal.. For example I have "photo1.jpg" and "photo2.jpg" files on my desktop. If I somehow, pass the names of these files in query string like www.mywebsite.com/index.php?pic1=photo1.jpg&photo2.jpg Could I upload these photos to my server automatically? Is there such a way in PHP? If so please explain to me a little.. I want this script because my webpage needs to upload certain pictures from PC and show them to user.. Any help is appreciated.. Thanks..
-
Hello, I want to have such a specific PHP script, which I will use only for a special purpose, not for hacking or anything bad or illegal.. For example I have "photo1.jpg" and "photo2.jpg" files on my desktop. If I somehow, pass the names of these files in query string like www.mywebsite.com/index.php?pic1=photo1.jpg&photo2.jpg Could I upload these photos to my server automatically? Is there such a way in PHP? If so please explain to me a little.. I want this script because my webpage needs to upload certain pictures from PC and show them to user.. Any help is appreciated.. Thanks..
-
What happens if files with those names do not exist? If you wish to know how to upload files in PHP then see https://www.google.com/search?q=file+upload+php[^].
Thanks for your reply.. The files will certainly exist, I know that otherwise the script will be meaningless. I know how to upload using a form but I want to do it automatically using query string.
-
Thanks for your reply.. The files will certainly exist, I know that otherwise the script will be meaningless. I know how to upload using a form but I want to do it automatically using query string.
-
Hello, I want to have such a specific PHP script, which I will use only for a special purpose, not for hacking or anything bad or illegal.. For example I have "photo1.jpg" and "photo2.jpg" files on my desktop. If I somehow, pass the names of these files in query string like www.mywebsite.com/index.php?pic1=photo1.jpg&photo2.jpg Could I upload these photos to my server automatically? Is there such a way in PHP? If so please explain to me a little.. I want this script because my webpage needs to upload certain pictures from PC and show them to user.. Any help is appreciated.. Thanks..
No, there's no way for a page to automatically upload specific files from the client to the server. If there was, it would be a major security hole. You can't even use script to set the value of an
<input type="file" />
, since that would have the same security implications. There are ways to make the upload easier for the user - for example, http://www.plupload.com/[^] - but nothing that will let you circumvent the need for the user to select the files to upload.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
No, there's no way for a page to automatically upload specific files from the client to the server. If there was, it would be a major security hole. You can't even use script to set the value of an
<input type="file" />
, since that would have the same security implications. There are ways to make the upload easier for the user - for example, http://www.plupload.com/[^] - but nothing that will let you circumvent the need for the user to select the files to upload.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Thank you very much..