Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Net / Sockets

Net / Sockets Components for network and related use

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-28-2009, 2:37 PM
VB.NET Forum Enthusiast
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: Jan 2009
Posts: 35
Reputation: 17
cwfontan is on a distinguished programming path ahead
Default Strange problem with looping stream ftp upload

k, looping through the file and writing peices via upload ftp... it leaves out some random parts of the txt file.. like 1 or 2 characters.. was leaving off more so I changed my divider to a double from integet and that corrected it a lot. I guess I need to be counting the actual bytes and dividing by that?

here is code help

pbUpload.Visible = True
Dim intFbytes As Double
Dim intOffset As Double
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream()
intFbytes = bFile.Length / 100
pbUpload.Maximum = 100
For I As Integer = 0 To 100
If intOffset + intFbytes > bFile.Length Then intFbytes = bFile.Length - intOffset
clsStream.Write(bFile, intOffset, intFbytes)
intOffset += intFbytes
pbUpload.Value = I
Next
clsStream.Close()
clsStream.Dispose()
pbUpload.Visible = False
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-28-2009, 2:43 PM
VB.NET Forum Enthusiast
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: Jan 2009
Posts: 35
Reputation: 17
cwfontan is on a distinguished programming path ahead
Default

resolved. fixed code..

pbUpload.Visible = True
Dim intFbytes As Integer
Dim intOffset As Integer
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream()
intFbytes = bFile.Length / 100
intFbytes = intFbytes + 1
pbUpload.Maximum = 100
For I As Integer = 0 To 100
If intOffset + intFbytes > bFile.Length Then intFbytes = bFile.Length - intOffset
clsStream.Write(bFile, intOffset, intFbytes)
intOffset += intFbytes
pbUpload.Value = I
Next
clsStream.Close()
clsStream.Dispose()
pbUpload.Visible = False
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 9:19 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.