Image Upload Script?

Discussion in 'Computer Programming, Emulation, and Game Modding' started by Twiffles, Aug 30, 2009.

Aug 30, 2009

Image Upload Script? by Twiffles at 7:33 AM (730 Views / 0 Likes) 1 replies

  1. Twiffles

    Member Twiffles танковые победы

    Sep 6, 2007
    I've been trying to find/make a simple PHP script that'll upload a picture, rename it with a random short name, then display the direct URL if it is successful.
    So far, I got to the upload part. It'll upload the picture, but it'll keep the original file name and won't spit out a URL. Just a success message.

    Which leads to my question: Does anyone have/know where to find a script that can do such a task?

    Thanks :x

    EDIT: Well, I figured out how to rename the file after upload. Now I just need a way to show me the URL to the image. xD
  2. Cyan

    Global Moderator Cyan GBATemp's lurking knight

    Oct 27, 2002
    Engine room, learning
    I found this on, if you use a form with method POST :

    CODEIt check if the uploaded file is correctly uploaded, and if it is, move it to the specified folder, so you could know the path to the file.

    $_FILE is an array with all the data from all the uploaded files (if there were many picture at once for example).
    You can check the array in comment from 18 mars 2009 :

    $_FILE[name of the 'type=file' input][$_FILE array name]

Share This Page