ftp from ASP.Net 2.0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I believe that I have spent days looking for a "HOW TO" on developing an ftp
process from an ASP.net 2.0 page that utilizes a "FileUpLoad" control.

Can I not just call the "SaveAS"(ftp_site, username, password + filename)
method? If I can't do this someone please point me in the direction of how
this task can get done.

Is there more to it? I don't know... that is why I am posting a call for help.
 
Thank you Juan for the link.
I received this error at the requeststream = uploadrequest.getstream
"ex.Message = "The requested URI is invalid for this FTP command."

This is how I populated the upload sub
If Me.File1.Value <> "" Then
Try
Upload(Me.File1.Value, "ftp://new file server.com/")
Catch ex As Exception
Me.txtSubmittedFile.Text = "Error: " & ex.Message.ToString
End Try
End If
If I need to pass the username and password would that cause the error?
 
re:
I received this error at the requeststream = uploadrequest.getstream
"ex.Message = "The requested URI is invalid for this FTP command."
If I need to pass the username and password would that cause the error?

If you need to pass a username and password, you can pass them with :

WebClient request = new WebClient();
request.Credentials = new NetworkCredential ("username", "password");




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Thank you!! Thank you!! I really appreciate the link and the last bit about
the password.

Again, Thank you!!!
 
re:
Thank you!! Thank you!! I really appreciate the link and the last bit about
the password.

Again, Thank you!!!

You're welcome! You're welcome! I really appreciate your enthusiasm!
Again, you're welcome!

:-)

I'm glad that tip got you up and running...
You just made my weekend a lot more pleasurable.

;-)




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
To extend this process, is it possible to loop through the reader(in the list
portion of the FTPSample kit) to create something like a treeview, that would
list the folders and files on an FTP server, should they want to download a
file from the server to their local machines?

Please point me to the next level.
 
You'll find all the info you need to build your client at :

http://dotnet.mvps.org/dotnet/faqs/?id=ftp&lang=en

There's a fairly good sample at :
http://support.microsoft.com/?scid=kb;EN-US;832679

There's a basic client sample at :
http://www.freevbcode.com/ShowCode.Asp?ID=4655

Another free sample is at :
http://www.codeproject.com/dotnet/dotnetftp.asp

Enjoy!


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Juan, Using the Microsoft link example, I run into an issue on the "Upload"
where the "SendCommand("PASV")". The "ReadLine" function errors out on the
following
line
m_iBytes = m_objClientSocket.Receive(m_aBuffer, m_aBuffer.Length, 0)
and returns a error of "An unknown, invalid, or unsupported option or level
was specified in getsocketopt or setsocketopt call"

Any idea what this is about? I am running this on an ASP.net 2.0 form that
just has a button to start this program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top