473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

FTP Upload - needs help badly

Hi,
Please help me with my vb dotnet code. I'm trying to upload a file to
an ftp website. The program seems hung on this line of code
"wrqToVendor.GetResponse". I'm not getting anything back.

I tried the webclient upload but it does not work for .NET framework
1.1. If you have any other suggestions, please let me know.

Appreciated your help in advance.

Teresa
Dim wrqToVendor As WebRequest
Dim wrsFromVendor As WebResponse
Dim thisStream As System.IO.Stream
Dim srReadLine As System.IO.StreamReader

wrqToVendor = WebRequest.Create("http://ftp.mywebsite.com" + "?" +
"c:\temp\test.txt")
wrqToVendor.Method = "PUT"
Dim myCred As New Net.NetworkCredential("myid", "mypassw")
wrqToVendor.Credentials = myCred
wrsFromVendor = wrqToVendor.GetResponse()
thisStream = wrsFromVendor.GetResponseStream
srReadLine = New System.IO.StreamReader(thisStream,
System.Text.Encoding.ASCII)

While (srReadLine.Peek() > -1)
value += srReadLine.ReadLine()
valueLineCount += 1
End While

wrsFromVendor.Close()
thisStream.Close()
srReadLine.Close()

Nov 21 '05 #1
3 1608
Hi,

Here is a link to an ftp class for vb.net. It includes an
example of uploading a file.

http://support.microsoft.com/default...b;en-us;832679

Ken
------------------
<tp****@pepco.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hi,
Please help me with my vb dotnet code. I'm trying to upload a file to
an ftp website. The program seems hung on this line of code
"wrqToVendor.GetResponse". I'm not getting anything back.

I tried the webclient upload but it does not work for .NET framework
1.1. If you have any other suggestions, please let me know.

Appreciated your help in advance.

Teresa
Dim wrqToVendor As WebRequest
Dim wrsFromVendor As WebResponse
Dim thisStream As System.IO.Stream
Dim srReadLine As System.IO.StreamReader

wrqToVendor = WebRequest.Create("http://ftp.mywebsite.com" + "?" +
"c:\temp\test.txt")
wrqToVendor.Method = "PUT"
Dim myCred As New Net.NetworkCredential("myid", "mypassw")
wrqToVendor.Credentials = myCred
wrsFromVendor = wrqToVendor.GetResponse()
thisStream = wrsFromVendor.GetResponseStream
srReadLine = New System.IO.StreamReader(thisStream,
System.Text.Encoding.ASCII)

While (srReadLine.Peek() > -1)
value += srReadLine.ReadLine()
valueLineCount += 1
End While

wrsFromVendor.Close()
thisStream.Close()
srReadLine.Close()
Nov 21 '05 #2
Thank you very much Ken. I'll check it out.

Teresa

Nov 21 '05 #3
If that doesn't work out for you (stability, consistent results,
generating events you need for status, doesn't work with your
particular FTP server, etc.) you can take a look at our
latest .NET FTP component:

http://www.xceedsoft.com/products/ftpnet

Take care,

On 11 Jun 2005 08:32:13 -0700, tp****@pepco.com wrote:
Thank you very much Ken. I'll check it out.

Teresa


--
Alex Leblanc
Xceed Software Inc.
http://www.xceedsoft.com

Check out our advanced .NET grid and SmartUI controls

Email: xL*******@xceedsoft.com (remove the first 'x')
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DH | last post by:
I have a "file upload form" that works OK, but I have been unsuccessful in my attempt to also resize the uploaded .JPG (if it is too wide), over-writing the original .JPG, and then create and save...
5
by: Thomas Brooks | last post by:
Hi there.... I have an ASP routine that I'm writing which updates an Access database with a user name, the file name, etc. all done through parameter processing and SQL functions. I do not...
4
by: NohaKhalifa | last post by:
Dear All; I'm developing a web site and i need to make adminisration for this site it's a site for Real Estates . But I don't need the administration to be online .. I want them to fill data...
4
by: Uncle Ben | last post by:
Is there any good and reliable Upload Component for ASP (or ASP.NET)? I need one which provides an upload status bar. As well, it must be able to handle more than 4 gigabytes of data transfer....
5
by: Kikoz | last post by:
Hi all. I assume that if the user uploads a file from aspx page IIS will put all future requests to the same page from other users in a line and all of them will be waiting until this upload...
1
by: theburnetts | last post by:
I am building an ASP.NET application that has a requirement that the user should be able to download all of the data that they have input into the system and save it to a file on their local PC. ...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
7
by: pbd22 | last post by:
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"...
9
by: Steve Poe | last post by:
I work for an animal hospital trying to use PHP to store an animal's dental x-rays to a file server. I can browse for the xray on the local desktop computer then click "Upload Image". This...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.