Browse button for server files?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
angelicodin
Forum Commoner
Posts: 81
Joined: Fri Nov 13, 2009 3:17 am
Location: Oregon, USA

Browse button for server files?

Post by angelicodin »

Hey ya guys.

I'm building this CMS panel and one of the things I would like to do for the blog section is have a button that will fill out an input field with the path or what not of a file on the server.

While I know I could just do a simple upload browse button for a pic, most of the ones I would be using are already on the server and would like to reduce the file redundancy.

Example: New post> Input all other information > click on browse button, but looks in the server rather than the local machine.

Possible?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Browse button for server files?

Post by pickle »

Yes - but not through the <input type = "file"> control. You want a file browser for the server side, so you'll have to use glob(), and realpath(), and maybe some other functions that can give you file lists from the server.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
angelicodin
Forum Commoner
Posts: 81
Joined: Fri Nov 13, 2009 3:17 am
Location: Oregon, USA

Re: Browse button for server files?

Post by angelicodin »

~sigh~ didn't think it was gonna be easy.

On the bright side, if I come up with a good solution I'll post it here in case someone else could make use of it, or make it better ;p
Post Reply