Re: probls with file upload script... pls help
- From: "pbd22" <dushkin@xxxxxxxxx>
- Date: 10 Dec 2006 08:11:19 -0800
hi kevin,
well, its the other way around. i am using an HTTP Web application to
upload files to an FTP server. i am new to this so, corrections
welcome.
the user is on the Web server where he accesses the upload page.
he uses the form outlined in the Stickman link to upload multiple
files. .
once he hits "upload" on the upload page, the script is called that
logs
onto the FTP server and sends the file from the user's computer to the
FTP server (via the Web server).
i was thinking that this will cause havoc on the http traffic and that
the best
way to do it is to redirect the users to the FTP server (for the
presentation layer)
so the whole upload process is handled by the FTP server. is this the
way to go?
So:
1. User Logs On To Web Server (ASP.NET Pages)
2. User Accesses Upload Form On Web Server
3. User Uses Hiddend Inputs To Upload Multiple Files
4. User Hits Upoload_Click On Same Form
5. Upload_Click runs VB.NET script that calls clsFTP
6. clsFTP is a script that logs onto the FTP server (a different
computer) and,
if all goes well, sends the file(s).
here is a link to clsFTP:
http://www.dotnethero.com/hero/vbnet/ftp.aspx?nmx=8_4
thanks again,
peter
Kevin Spencer wrote:
Forgive me if I'm misunderstanding you, but it sounds like you're using an
FTP client to upload a file to an HTTP web application. Can you be more
specific about the Work Flow of your app? Apparently, you have an ASP.Net
page that has a file upload element in it, and the file begins by uploading
a file via HTTP (your ASP.Net page) to your web server. What happens after
that? How is the uploaded file handled by your web application? Is your web
application attempting to transfer it to an FTP server, or what?
--
HTH,
Kevin Spencer
Microsoft MVP
Logostician
http://unclechutney.blogspot.com
There is a madness to my method.
"pbd22" <dushkin@xxxxxxxxx> wrote in message
news:1165695219.584239.45990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi.
i am having probs understanding how to grab a file being uploaded from
a remote client. i am using hidden input fields for upload such as:
<input id="my_file_element" type="file" name="file_1" size=46 /><input
type=submit />
so, after adding a few files, the input fields look like this:
<input name="file_3" type="file"><input style="position: absolute;
left: -1000px;" name="file_2" type="file"><input style="position:
absolute; left: -1000px;" name="file_1" type="file"><input
style="position: absolute; left: -1000px;" id="my_file_element"
name="file_0" size="46" type="file"><input type="submit">
I am using the microsoft-provided clsFTP class for uploading files to
my server. below is the code that calls the class and attempts to
upload the user-added files...
Dim ftpClient As New Code.clsFTP("192.168.10.10", "", "anonymous",
Context.User.Identity.Name, 20)
If (ftpClient.Login() = True) Then
'Create a new folder
ftpClient.CreateDirectory("FTPFOLDERNEW")
'Set our new folder as our active directory
ftpClient.ChangeDirectory("FTPFOLDERNEW")
'Set FTP mode
ftpClient.SetBinaryMode(True)
// TEST HERE WITH FILE_1 - ALWAYS FAILS
dim params as String = Request.Params.Get("file_1")
'Upload a file from your local hard disk to the FTP site.
ftpClient.UploadFile(Server.MapPath(params))
ftpClient.CloseConnection()
End If
OK. the problem is that when Request.Params.Get("file_1") is called, it
gets the string path
of the file. so, ftpClientUploadFile looks for that string in the local
directory, be it Server.MapPath or simply ftpClient.UploadFile(params).
Since this file is coming from the *user's computer* and not my Web
Server, how do i do this?
eagerly awaiting responses...
.
- Follow-Ups:
- Re: probls with file upload script... pls help
- From: Kevin Spencer
- Re: probls with file upload script... pls help
- From: pbd22
- Re: probls with file upload script... pls help
- References:
- probls with file upload script... pls help
- From: pbd22
- Re: probls with file upload script... pls help
- From: Kevin Spencer
- probls with file upload script... pls help
- Prev by Date: can i change it??
- Next by Date: drop down selected index
- Previous by thread: Re: probls with file upload script... pls help
- Next by thread: Re: probls with file upload script... pls help
- Index(es):
Relevant Pages
|