- Joined
- Dec 22, 2007
- Messages
- 184 (0.03/day)
- Location
- Central Nebraska
System Name | CORSAIR |
---|---|
Processor | AMD Phenom 1090T x6 @3.2 |
Motherboard | Gigabyte Ga-78LMT-S2P |
Cooling | High efficiency dust cooling |
Memory | 8GB GSkill DDR3 1333 |
Video Card(s) | Sapphire Radeon HD3870 512MB GDDR4 PCI-e toxic |
Storage | Seagate SV35.3 ST3250310SV 250GB SATAII(Windows 7 Pro x64), 320GB Samsung SATAII(Storage and SuSE) |
Display(s) | Dell 20" LCD, Dell 17" LCD |
Power Supply | Antec Cool Blue 650W Modular |
Software | Windows 7 Professional SP1, Visual Studio 2010 Ultimate |
Hello all,
I'm working on an app that uses FTP to transfer a file to a server, however, currently writes the file to memory while sending. It also never releases the memory it used to send. Is there any way to break the file into chunks as it sends? App becomes unstable when used with large files.
I'm working on an app that uses FTP to transfer a file to a server, however, currently writes the file to memory while sending. It also never releases the memory it used to send. Is there any way to break the file into chunks as it sends? App becomes unstable when used with large files.
Code:
Do Until sent = True
Try
Dim FiletoSend() As Byte = System.IO.File.ReadAllBytes(SendFile)
Dim SendFileStream As System.IO.Stream = FTPRequest.GetRequestStream()
My.Settings.Status = "Uploading File..."
My.Settings.Save()
TrayIcon.BalloonTipText = My.Settings.Status
If TrayIcon.Visible = True Then
TrayIcon.ShowBalloonTip(5000)
End If
SendFileStream.Write(FiletoSend, 0, FiletoSend.Length)
SendFileStream.Close()
SendFileStream.Dispose()
My.Settings.Status = "File Uploaded Successfully."
My.Settings.Save()
TrayIcon.BalloonTipText = My.Settings.Status
If TrayIcon.Visible = True Then
TrayIcon.ShowBalloonTip(5000)
End If
sent = True
Catch
Thread.Sleep(1000)
End Try
Loop
End Sub