Jump to content

Recommended Posts

Hi!

I have stumbled on a feature in which I am unable to get around my head. I was wondering if anyone knew a script which allows a user to upload a file to a specific directory through html?

So there could be 5 upload boxes for images, and then at the bottom of the html there could be a submission form which selects what directory the file is uploaded to?

I'm trying to not sound confusing but an example is I could upload "moonmoon.jpg1","moonmoon2.jpg", "moonmoon3.jpg" 
to "mysite.com/goddamnit/images" without evening leaving the page "mysite.com/upload".

I would be really grateful if anyone has a php script and html piece which could allow me to get over this problem.

-bluespiked icon_smile.gif

Who invited Moon Moon!?

 

Don't give users the ability to upload to any directory they wish. If you have real, actual directories then make a list of ones you do want users to be able to upload into and provide that in a dropdown or something. (Then make sure to validate that what they choose really is in that list.) If you do want any arbitrary directory then you need something smarter...

Hi!

 

I think I see where your coming from. It was meant to be a closed system for just one person to access. I just have a PHP script which generates a new directory (for an image album) with a custom name (because the directory name appears as the album name). I was hoping to find a way to upload images to this newly generated directory. 

Well... alright.

 

Assuming all the directories to choose from are at the same level (same parent directory) then glob + GLOB_ONLYDIR will get you an array of names you can stick into a

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.