-1

Wondering if its possible to do a file upload by already having an upload PHP script, but it only processes when passed variables/parameters through URL. for example

https://example.com/upload.php?localdesktopfile=<somefile>&&otherdetails=<details>

etc. I don't know what this process information passed with the URL is called as i 've never done it when using PHP, but I was wondering if its possible this way and if any examples or code can be provided for me to parse and configure as well.

CorePixels
  • 29
  • 5
  • Under Do you mean the file name or file contents? – Your Common Sense Mar 13 '23 at 04:50
  • the file location on the PC – CorePixels Mar 13 '23 at 04:52
  • And WHAT php is supposed to do with your location? Take uber, break into your home, turn on the PC, put in the flash drive and copy that file? – Your Common Sense Mar 13 '23 at 04:53
  • Ever tried to fancey WHAT would be the world if a website would be able to copy a file from a visitor's desktop? – Your Common Sense Mar 13 '23 at 04:54
  • Just to make sure. Do you realize that PHP runs not in the browser? But on the server a thousand miles away? – Your Common Sense Mar 13 '23 at 04:58
  • Anyone who finds this question, know that it was closed and is not a duplicate. the person that closed it obviously does not understand the question, but abused their reputations actions to close it and falsely mark it. This was answered by the person below however who understood the question. – CorePixels Mar 14 '23 at 06:29
  • That's a very funny comment. As long as you are developing on the same PC that serves as both a server and a client, it would work. But as soon as it will go live, you will find a little problem "uploading a local file to a website" having only its location on the client PC :))) – Your Common Sense Mar 14 '23 at 07:01
  • Not to mention it will be a bit of a problem to even learn that location – Your Common Sense Mar 14 '23 at 07:04

1 Answers1

0

Yes it's possible,

You have to use $_Get, superglobal array to access the parameters passed through the URL in your PHP script.

You can access the localdesktopfile parameter in your PHP script like this:

$localdesktopfile = $_GET['localdesktopfile'];

And you can access the otherdetails parameter like this:

$otherdetails = $_GET['otherdetails'];

However, it's really not secure and easily manipulable

Akameuh
  • 36
  • 1