Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. File Upload Using Query String in PHP

File Upload Using Query String in PHP

Scheduled Pinned Locked Moved Web Development
databasephpcomsysadmintools
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jasonalien
    wrote on last edited by
    #1

    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..

    L Richard DeemingR 2 Replies Last reply
    0
    • J jasonalien

      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..

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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[^].

      J 1 Reply Last reply
      0
      • L Lost User

        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[^].

        J Offline
        J Offline
        jasonalien
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • J jasonalien

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Then your query string needs to interact with the file upload code.

          1 Reply Last reply
          0
          • J jasonalien

            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..

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            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

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            J 1 Reply Last reply
            0
            • Richard DeemingR Richard Deeming

              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

              J Offline
              J Offline
              jasonalien
              wrote on last edited by
              #6

              Thank you very much..

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups