Jump to content

Browse from root directory!


Go to solution Solved by cyberRobot,

Recommended Posts

Hi there guys,
 
I wish if u can to help me solve a little problem.
I upload my pictures into a folder on the server (website.com/uploads) using a upload script.
Now i have a form with 3 fields (title, picture, and description)
At the picture field my code looks like this:

<label>Picture:</label>
<input type="file" name="title" id="title" class="text-long" />

Now when i click on the browse button i want to select the picture that i've added in my upload folder insted of a file from the pc

 

How can i do that? I'm waiting for your answers. Thank you very much!

 

Link to comment
https://forums.phpfreaks.com/topic/282091-browse-from-root-directory/
Share on other sites

 


 i want to select the picture that i've added in my upload folder insted of a file from the pc

 

The "file" input type is only for uploading files. Anyway, you definately don't want you website to show files from your server directly, that would open up all kinds of problems with hackers.

 

What you can do, quite easily if you follow the tutorials, is create an unordered list in which you print the names of the files in your images directory (and only the files in the images directory). Then you can select an image by name only, and store additional data for that filename.

 

But, what yo are making sounds like a regular gallery so you might be better off looking at how existing gallery scripts do this, and copy... uhm I mean: learn from that. :-)

  • Solution

Sorry, I'm a little confused as to what you're asking. It sounds like you already have a upload process up and running. It also sounds like pictures have already been uploaded using this solution. Now it sounds like you're trying to create a separate solution for viewing the uploaded images...is that correct?

 

If so, have you considered using the <select> tag?

http://www.tizag.com/htmlT/htmlselect.php

 

The tag could be populated from a database...or a solution like vinny42 suggested.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.