Jump to content

file directory


OAFC_Rob

Recommended Posts

I'm in the middle of making my own CMS system, where a user can create a page online via a text editor, I know how to create and save the file, but to make the process easier I would like to a function where a user can click a button find a list of files and folders, pick the folder location to save a new file to.

 

Instead of having to type something like this /commonPages/aboutUs/

 

with the file name being test.php

 

What would be the easiest way to do this?

 

I have just been looking at opendir() and my first thought was to use <input type="file" />, but then I remember that was only for inputting a particular file name, which would be useful for renaming a file at a later date.

 

For example, if we wanted to change test.php to something more meaningful ie history.php

Link to comment
Share on other sites

Yeah had a quick look at that and was trying to decide which was better for my situation, is there are any to implement either a browse button or structure that would make it easier for the user. I have quickly implemented opendir on the entire directory, echoing out files and folders.

 

This is a good start, but doesn't mean squat to the user really, any suggestions?

 

Also there could potentially be security risks coupled with this, ie the user seeing folders I dont want them to see or have access to. What limitations can I enforce?

Link to comment
Share on other sites

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.