-
December 10th, 2001, 11:48 PM
#1
Junior Member
Need ideas for Web based file dloads...
need:
I need to put up an FTP server for clients and associates to grab files from.
problem:
most of my clients and associates are too computer illiterate to use an ftp client, even installing the client program would prove to be unlikely on their behalf.
possible solution:
Find a way to use html web site for users to goto using their web browser.
They would click on "files" and a logon box appears.
then they logon and can drag and drop files to their desktop.
Voila!! Is this even possible??
Can you l33t folks give me some clues on how to approach this "hack" of mine? Thanks d00dz!
</p3ace/out>
Half the world is composed of people who have something to say and can\'t, and the other half who have nothing to say and keep on saying it.
-
December 11th, 2001, 12:06 AM
#2
If we're talking computer illiterate, we're talking Internet Explorer, right? You can connect to an ftp-server using IExplore: just tell your users to go to ftp://ip.or.something/ You can even make link it trough some html, targetted at another window. They can drag and drop from there.
If you want to have different users log on on your website, link them to ftp://user:password@ip.or.something/
You could write some fancy PHP or something, your users wouldn't notice any of it.
Hope this helps...
-
December 11th, 2001, 03:16 AM
#3
after you get them set up to log in at an html site.... the basic commands for an upload/download page are all javascript.... this is *roughly* what i would do... meaning this may not exactly work... i wrote this in about 2 minutes....
/* start script and declare variables
<script language=Javascript>
var cmsg, pmsg, retstr, validstr, cdirretstr;
/*this function allows you to check if an item is selected (in
/*list box)before trying the other features
function checkSelected(x) {
if (x == -1) {
alert("You must first select a file or folder before choosing this action.")
return false; }
else return true;
}
/*this function allows them to create a directory
function createdir(currdir) {
pmsg = "Enter the new directory name:";
validstr = "Enter a valid directory name";
cdirretstr = prompt(pmsg,validstr);
if (cdirretstr != null) {
document.cdir.nf.value = currdir;
document.cdir.newdir.value = cdirretstr;
document.cdir.submit();
}
/*this allows the user to edit a file
function editfile(editthis) {
document.editform.file2edit.value = editthis;
document.editform.submit();
}
/*user can create a new file
function newfile(thisdir) {
document.newfileform.fcurrdir.value = thisdir;
document.newfileform.submit();
}
/*user can downloadfile file
function dfile(file2d) {
document.downloadfileform.file2download.value = file2d;
document.downloadfileform.submit();
}
/*view file
function viewfile(file2view) {
file2view = file2view.replace("/","\\")
dname = "www25";
file2view = 'http://' + dname + '.brinkster.com/lorddarkside' + file2view
document.viewfileform.f2v.value = file2view;
document.viewfileform.submit();
}
/* delete file
function delfile(file2del) {
cmsg = "If you have selected a folder, the folder and all of it's contents will be deleted.\n\n"
cmsg = cmsg + "Are you sure you want to delete " + file2del + "?"
if (confirm(cmsg)) {
document.delform.nf.value = file2del;
document.delform.fsel.value = file2del;
document.delform.submit();
}
/* rename file
function renfile(file2ren) {
pmsg = "Enter the new name or press 'Cancel'.\n";
pmsg = pmsg + "DO NOT include the path.\n";
pmsg = pmsg + "CAUTION: This action will overwrite a file with the same name.\n";
retstr = prompt(pmsg,"Enter a valid directory or file name");
if (retstr != null) {
// alert("retstr=" + retstr + "\nnewname=" + newname);
document.renform.nf.value = file2ren;
document.renform.fsel.value = file2ren;
document.renform.newname.value = retstr;
document.renform.submit(); }
}
}
</script>
/*then to enact these functions....
<form name=delform action='FileManager.asp' method=post>
<input type=hidden name=faction value=del>
<input type=hidden name=nf value="">
<input type=hidden name=fsel value="">
</form>
<form name=renform action='FileManager.asp' method=post>
<input type=hidden name=faction value=ren>
<input type=hidden name=nf value="">
<input type=hidden name=fsel value="">
<input type=hidden name=newname value="">
</form>
<form name=cdir action='FileManager.asp' method=post>
<input type=hidden name=faction value=cdir>
<input type=hidden name=nf value="">
<input type=hidden name=newdir value="">
</form>
<form name=editform action='FileManagerEdit.asp' method=post>
<input type=hidden name=faction value=editfile>
<input type=hidden name=file2edit value="">
</form>
<form name=downloadfileform action='Type-In-Your-File-Name-Here.asp' method=post>
<input type=hidden name=faction value=downloadfile>
<input type=hidden name=file2download value="">
</form>
<form name=viewfileform action='FileManagerViewFile.asp' method=post target=_blank>
<input type=hidden name=f2v value="">
</form>
/*make buttons.... using style sheets
<font class=Font10>
<input type=button style='#122' class='Font9BoldWhite' name=b1 value='Open Selected Dir' onClick="document.f1.faction.value='1'; document.f1.submit();">
<font class=Font10>
<input type=button style='background:#336699' class='Font9BoldWhite' name=b4 value='Delete' onClick="if(checkSelected(document.f1.fsel.selectedIndex)) delfile(document.f1.fsel[document.f1.fsel.selectedIndex].value);"><input type=button style='background:#336699' class='Font9BoldWhite' name=b4 value='Rename' onClick="if(checkSelected(document.f1.fsel.selectedIndex)) renfile(document.f1.fsel[document.f1.fsel.selectedIndex].value);">
<font class=Font10>
<input type=button style='background:#336699' class='Font9BoldWhite' name=b6 value='Create Dir' onClick="createdir('');"><input type=button style='background:#336699' class='Font9BoldWhite' name=b7 value='Edit File' onClick="if(checkSelected(document.f1.fsel.selectedIndex)) editfile(document.f1.fsel[document.f1.fsel.selectedIndex].value);">
<font class=Font10>
<input type=button style='background:#336699' class='Font9BoldWhite' name=b7 value='Create New File' onClick="newfile('');">
<font class=Font10>
<input type=button style='background:#336699' class='Font9BoldWhite' name=b8 value='Download File' onClick="if(checkSelected(document.f1.fsel.selectedIndex)) dfile(document.f1.fsel[document.f1.fsel.selectedIndex].value);"><input type=button style='background:#336699' class='Font9BoldWhite' name=b9 value='View' onClick="if(checkSelected(document.f1.fsel.selectedIndex)) viewfile(document.f1.fsel[document.f1.fsel.selectedIndex].value);"></font></form>
/*then we make the upload section.
<form name=uploadfiles action='FileManagerUploadFiles.asp?nf=' enctype="MULTIPART/FORM-DATA" method=post>
<input type=file name=file1 size=30 class=Font9Bold>
<input type=file name=file2 size=30 class=Font9Bold>
<input type=file name=file3 size=30 class=Font9Bold>
<input type=file name=file4 size=30 class=Font9Bold>
<input type=file name=file5 size=30 class=Font9Bold>
</font><input type=submit style='background:#336699' class='Font9BoldWhite' value='Start File(s) Upload'></font>
the upload section takes them to a new page showing the upload as successfull (you'll have to make that one yourself.....) but that is the basic components.... at least in theory... i didn't test it, but it essentially should work... *note that is ESSENTIALLY, it may require tweaking... let me know if it helps
EDIT ps... you need to make the rest of the page... in case you didn't know that and you need to make the list box.... if you have a problem with that let me know.... that is a whole nother mess of code
-
December 11th, 2001, 06:51 AM
#4
Senior Member
An ASP solution
Ok, here's a solution in asp. Click here to see what my sample page looks like (note, the code is an exact copy, minus the folder location). Hope it works out for you, it's really easy to see it and all you have to do yourself is get them to log on to the page before they get to this! Good luck!
Code:
<%@ Language=VBScript %>
<% OPTION EXPLICIT %>
<html><body>
<font face="Verdana, Arial, Sans-serif">
<%
Dim objFSO
Dim objFolder
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(exactStrToFolder)
'The location of the folder you want to start at, ie "C:\Windows"
fileLoop objFolder, 0, ""
'**** Clean-up
Set objFolder = Nothing
Set objFSO = Nothing
%>
</font>
</body></html>
<%
Sub fileLoop( pobjFolder, pintDepth, pstrPath )
Dim objItem, I, strPath
Response.Write "[*]" & UCase( pobjFolder.name) & "<ul>"
For Each objItem In pobjFolder.Files
strPath = pstrPath & "\" & pobjFolder.name & "\" & objItem.name
Response.Write "[*]" & objItem.name & ""
'**** For-loop Clean-up
Set objItem = Nothing
Next 'objItem
For Each objItem In pobjFolder.SubFolders
fileLoop objItem, (pintDepth+1), (pstrPath & "\" & pobjFolder.name)
Next 'objItem
Response.Write "[/list]"
'**** Clean-up
Set pobjFolder = Nothing
Set I = Nothing
Set strPath = Nothing
End Sub
%>
- Stronzo
\"Vini, Vici, Vidi\"
I came, I saw, I conquered.
- Julius Caesar
-
December 11th, 2001, 07:11 AM
#5
yours was much easier Stronzo (lol) javascript was just the first thing i though of
-
December 11th, 2001, 07:26 AM
#6
passwords
It appeard to me that the question was more about how to authenticate users before they had access to the downloadable files. I have never done this myself, so I won't make a suggestion on how to do it. I know that you use cookies once the client has loged in though.
I am not positive if that was the question, but I just thought that if it was, someone might post the answer for you.
-
December 11th, 2001, 08:20 AM
#7
It is possible to do the whole login thing..
What web/ftp server are you using?
-Matty_Cross
\"Isn\'t sanity just a one trick pony anyway? I mean, all you get is one trick. Rational Thinking.
But when you\'re good and crazy, hehe, the skies the limit!!\"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|