zazu Posted September 12, 2013 Share Posted September 12, 2013 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! Quote Link to comment https://forums.phpfreaks.com/topic/282091-browse-from-root-directory/ Share on other sites More sharing options...
vinny42 Posted September 12, 2013 Share Posted September 12, 2013 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. :-) Quote Link to comment https://forums.phpfreaks.com/topic/282091-browse-from-root-directory/#findComment-1449205 Share on other sites More sharing options...
zazu Posted September 12, 2013 Author Share Posted September 12, 2013 Thanks man. I've already done that, and works very fine, but i don't like how it looks on page, and i tought that can be another solution to this. Thnak you for your answer. Quote Link to comment https://forums.phpfreaks.com/topic/282091-browse-from-root-directory/#findComment-1449206 Share on other sites More sharing options...
Solution cyberRobot Posted September 12, 2013 Solution Share Posted September 12, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/282091-browse-from-root-directory/#findComment-1449218 Share on other sites More sharing options...
zazu Posted September 12, 2013 Author Share Posted September 12, 2013 Hey, Yes, i've solved the problem with the exact solution that you offer and it works just fine. Thank you for your help. Quote Link to comment https://forums.phpfreaks.com/topic/282091-browse-from-root-directory/#findComment-1449229 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.