/    Sign up×
Community /Pin to ProfileBookmark

choose a directory

Hello,

I want to get a path-information into a variable. (the target where some files should be saved). Is there a way to make input-fields accept directories instead of files?

Alex

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@HellspireSep 13.2004 — Um, do you want to reach this determination during the processing of your form, or during the inital output of your form to the user????


I am not too familiar with working with files, however, if memory serves....

All uploads are moved to the /tmp directory, then they are moved to the space you declare, in which case you would have to look into the dir() chdir() and mkdir() functions in php. Good luck
Copy linkTweet thisAlerts:
@ChickenmanauthorSep 13.2004 — I refer to files, which are 'SELECT * INTO OUTFILE'-Textfiles. They should be saved somewhere on the client. I could generally use C:/temp but I want to keep it open for the user. So he can type 'C:/temp' or something else and the rest is done by the script. I could ask him to choose a file in the target-location and then cut the filename off the URL. But all that is not really elegant.

Alex
Copy linkTweet thisAlerts:
@HellspireSep 13.2004 — If i understand you correctly, allowing a user to select a directory, would require you to grant permissions to all files appropriated. Furthermore, granting access to all folders on the system (which is what I gathered from c:temp) you open your server to all forms of security issues and possibilities of attack. Having them select a directory, or creating one for each logged in user in question, could allow you to effectively grant them access to any directory they wish, so long as it falls within their folder root. Even then, you will require security measures to make sure they cannot use absolute directories and such, and potentially damage the system as I have said.
Copy linkTweet thisAlerts:
@ChickenmanauthorSep 13.2004 — With the input type=file field he browses the client, not the server. But you're right. Thanks.
×

Success!

Help @Chickenman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...