How to display folder contents on a site?
Spinner
Birmingham, UK
Hi folks
I'm just in the process of adding a private members area to a website I'm working on.
I've created a basic Frontpage 2003 upload form so members can upload files or whatever to a folder on the server. Currently that's working great. However...
I want people to be able to see the contents of the folder containing the uploaded files and for them to also have the ability to download any of the files contained if they wish.
Idealy it would be as a drop down menu displaying the folder contents, which when one is selected can be downloaded by clicking a download button.
But at the very least I'm trying to figure out how to get the folder contents to be displayed just as something as simple as in an inline frame. Currently people can upload stuff to share with other people, but other people can't get access to it because they can't view the web folder.
Can any one help me out with this. The site is hosted on a Windows .NET server.
Thanks in advance.
Spinner
Note: I have no coding experience and use FrontPage for site building. So I'm a bit of a newb.
I'm just in the process of adding a private members area to a website I'm working on.
I've created a basic Frontpage 2003 upload form so members can upload files or whatever to a folder on the server. Currently that's working great. However...
I want people to be able to see the contents of the folder containing the uploaded files and for them to also have the ability to download any of the files contained if they wish.
Idealy it would be as a drop down menu displaying the folder contents, which when one is selected can be downloaded by clicking a download button.
But at the very least I'm trying to figure out how to get the folder contents to be displayed just as something as simple as in an inline frame. Currently people can upload stuff to share with other people, but other people can't get access to it because they can't view the web folder.
Can any one help me out with this. The site is hosted on a Windows .NET server.
Thanks in advance.
Spinner
Note: I have no coding experience and use FrontPage for site building. So I'm a bit of a newb.
0
Comments
Ideally, Spinner, just to keep yourself out of trouble, I would keep downloads separate from uploads. And then offer them as FTP download area. IF you want to let all members download, than the FTPs (FTP linkaging starting from an HTTPS login) might use a member's ID to login to the FTP area, then they could see an FTP style file list and maybe a text file of contents with program descriptions. IF it is just a few friends, you could use member IDs and let folks upload and download from same login, that is easiest way to do this. If you want to vet stuff, virus scan it, etc before letting folks download, then set up one folder with upload only perms and another with download only perms. READ-Only can be downloaded (from an FTP outbound share within HTTPS tunnel), write only can be uploaded (and can be done from same kind of FTP within an HTTPS connect).
Look at the code at http://www.ibiblio.org/ for basics of that kind, populating a form from a directory dynamically COULD be done with a database build&feed to a form dropdown but probably easier to start with pure FTP. second way is to take a form input, gen an email reply with a download link, and tell user reciviing email to use thier member login for this area. Then a user auth could be done more easily using members login data as FTP auth data. With a totally open share, it is dang HARD to keep things from being corrupted, and ditto is true if users can upload and download as if a user gets his\her ID compromised the person with that data can then replace good with corrupt stuff.
I could give you some links, but they would be finely detailled at dev levle for .NET stuff. At htpp://www.w3c.org/ there are traditonal way docs and you might see what you get to work simply by starting there and then debugging to .NET (AKA MSXML 4 or 5, I expect version 5 of MSXML to come out in next year worht of months as even v5 of WindowsUpdate (the beta WindowsUpdate that MS hooks SP2 RC2 testing users to) will need some of the things in that also. GIVEN some international pressures on Microsoft, I think MSXML 5.0 might be more cross-portable to w3c XML than earlier versions, also.
I will add this:
There is open socurce code to gen an HTML directory from a file directory, on the fly. that gen can be used to link to an info page about each file that is pure HTML table, from an SQL database of info about the files. It can also link offsite, so if you have files you want to link to and let someone else carry the bandwidth load for the FTP it can provide for that also with a simple HTML link. MSXML should have something similar linked to a TFTP (see trivial FTP at w3c.org) download, which is what ibiblio (AKA UNC's Metalab cluster-fed file download site) uses to get FTP from HTML links. Ibiblio also has a pure FTP access, and recommends it as it is faster to FTP than to use TFTP. It is called RPM2HTML and could be modded within the open source license to be used for a pure directory to HTMl dyn gen. That code set is tiny and FAST response code. I have seen PHP and Perl code used for this, and Python code to pull from a DB and gen dyn page or field data for a form in HTML or XML or Java+XML.
Genning pure HTML dynamically gives you up to date lists by itself also, trick is to avoid folks getting part of a file when someone is still uploading it if you use one file area shared for both. I have done this myself various places, an FTP server thta is still syncing can have the file indexed but not all present yet. Looks like a corrupt archive to downloader.
The best FTP sites lock files that are being uploaded until completely uploaded or separate out files being uploaded from those being offered to download by directory with a transfer that can be scripted or done by the site admin or some combo. I prefer the latter, and anyone on dialup REALLY will appreciate this as redoing things like long files that arrive partially usually results in a transfer restart and not a resume as last packet is all too often a partial packet given Murphy and the process nature of allowing access to partially loaded files-- doing it in one area is a code problem, in two, it is much easier to code. That kind of partial transfer failure due to partial presence of file at time of download request dramatically increases unneeded bandwidth flow and user frustration and is why most sites separate inflow areas from outflow areas.
However I have no idea how to setup up stuff like that.
I mean yeah sure, I could just give people access to the site via a standard FTP client, but because I use FrontPage 2003 and FrontPage extensions and all that stuff, I was under the impression I should only use FrontPage to upload and download files. But if I interpret your first paragraph correctly, you're talking about some sort of FTP linkage from the site itself. Like I said, I have no idea about how to do any of that even if it wouldn't screw up the site's extensions.
I was under the impression folder tree displays can be accomplished by certain ASP commands relating to server lookups, but again, I have no idea about anything like that.
I like the sound of the FTP idea though, but how do-able is it, considering what I mentioned above about the FrontPage extensions. Currently, when I log-on to the site's server through FTP, it screws up all the extensions.
I will let someone else handle frontpage implications, but FTP and SFTP are done world wide. there is no reason FrontPage SHOULD not be able to link to standard FTP, though. No reason at all. this sounds like a hosted site you are talking about, not a dedicated server. A dedicated server is easier to do this on, much easier. ESPECIALLY if fiel areas need to be set up that are not served through frontpage. Let's say you set up a file input area. you can feed a link from frontpage, like this:
ftp://ftp.johndanielsonii.com/uploads/ (non-existent, used to show format of call) and folks will get a directory out of IE if this is an TFTP pipe (IE link from withing HTML code) by the nature of IE responding to the ftp:// start with a switch to its primitive mini-FTP client. You could also use pure file links, as FTP calls to a directory on your site's server. MOZILLA ACTUALLY WILL RESPOND BETTER, IT HAS A RESUMABLE ftp CLIENT BUILTIN TO IT.
I use ftp to upload and download and rsync my sites from here, and the server works with auth allowing certain folder access. On a shared host you get a mess with this, the host admin has to help set it up and should. Then you as site coder simply provide links or ways to make a list from contents with code that is run with access to that folder.
Just as Mailto: is a call that browsers know to use to call the default email program they are told to use, so FTP can autocall a builtin or external FTP applet or full app at client end. All site code itself has to do, if the host admin is good, is offer file. Period. Browser or FTP client simply takes the file, and with an FTP link offer, client or browser end should not display the thing by default unless it is something like a .pdf file (which could be offered as a pure file link in HTML).
Take your IE, go to ftp://ftp.ibiblio.org/pub/ as an address you click on from here, see what happens. Click on anything underlined or iconed and see what happens. they are simply telling browser to switch modes and providing FTP services on thier end by sharing folder for read access. Browser client takes the dang file, and becasue of FTP it just accepts it as a downloadable and asks if you want to save or open it in IE, and in Mozilla recommends saving it unless you ahve a Mozilla set up like I do here-- mine opens Acrobat Reader, which accepts the file here from any website. Browsers whoudl handle ftp innately, and your site end needs, if hosted or managed by host, simply to offer the file as an FTP link. TOO simple, folks think that they have to code the protoocl itself, server should be able to handle a switch to FTP linking when browser asks for same. Uploads, you will want a form for, and simplest way to handle is to email form data to admin or wbemaster and let webmaster update data as needed and then ok file for download by transferring to downloads folder-- delayed release for download occurs, but is much safer and much easier to code.
If you want a pure link to ftp in new browser session, simply make your href link coded to a target of _blank. This is commonly done. That is how sites tell IE and all browsers to open new windows, by default. Its harder to code a site to open a new TABBED session than a Window. Any host that allows ftp should be able to set service layers up FOR you, so unless you yourself are hosting and coding, that is host admin job to set up that service where you want it (as far as folders used and perms) if you have a dedicated server.
Then you could hit it with any ftp client or even IE itself and see the contents and copy to or from it if your user/password had the appropriate privledges.
Thats really easy and you could be up in ten minutes to start testing. You could alwasy change it to another form later if your unhappy with the format.
Tex
I don't quite understand what you mean. It's not a dedicated server. Forgive my lack of understanding in these area's. Could you explain for me what you mean exactly.
I read something about that too, but I think it requires either something doing at the server end, for which I have no access, or some kind of look up script added to the site.
I think for now I'll pursue John's suggestions, I think if it works the result would be the easiest option for me. I'll post back once I've had a fiddle.
Thanks fella's.
So I'm back to square one. Any other ideas?
Whos' the host mate? Do they have any PHP support at all ?
Time to dig out an .NET book..
The site in question is using their MS Home hosting package. Which is IES/6.0. No PHP support what so ever.
I think this is all just crazy. I mean, what could be more simplier than a directory listing? I've been trying to find a script which can do it, but all the ones I've found are ASP reliant and even if the hosting server did support that, I wouldn't now how to implement it.
/me shakes his fist
All I want is specific users (the band I'm in) to be able to upload files (which I can do) and then have others be able to download it from a folder listing (which I can't).
They're you go. But like I said, I'm pretty sure the hosting package I'm on doesn't support ASP scripts. It's all just over my head, and I'm pretty tall!
Thanks for your time mate.
It should work just fine. For the sake of the safety of your site, lets take this PM ...
He's set me up with exactly what I wanted, a fully functional and useable folder navigation tree.
Kudos to all of you for your help, but Shorty gets the medal for this one.
Boy is he good. :ukflag:
All hail our great leader!
I found a more usuable self contained ASP app, edited a few constants and twiddled around with the few bits of ASP I do know.. and it's sorted.
Mission was to make sure it didn't break any frontpage extensions stuff AND only use the basic VBscript classes.
PS: Since you dumped your girl, would you mind sending me her phone number?
I'm very concerned about the two of you.
Can you post/PM a link so I can check it out?
Thanks...
X
http://www.voodooz.com/ASPExplorer/