By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,402 Members | 1,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,402 IT Pros & Developers. It's quick & easy.

Need Help with code problem Willing to pay for help Please...

P: n/a
Hi,

I am new to this forumand I apologize as i am not a .net programmer but we
have a program being developed by a .net programmer. Nowwe have run into an
ftp snag and I think it is part ftp and part .net coding.

Heres the issue..

We have an image directory full of photos like 200,000 in it, and if you use
an ftp client to ftp to the site and then navagate to that file it will try
to read it / open it. Well of course it will time out and I understand that.
Now if i drag an image from my PC in the ftp client and drop it on top the
folder with the images it saves it there fine no error or timeout.

So our program will be uploading images to this dir and we need to have it
save the image to this dir and not open or read it just save the file to it.
Below is the code being used for the image upload and it still times out it
is obvious it is trying to read the file first.

Two questions is there an alternate way to ftp, a different command maybe..

Or better yet another way to get images from the users computer using this
program to our server??

Open to all ideas willing to pay for a fix / work around.

Code below and other forums we posted this on please review all data and
other forums we have put this on perl forums because our site uses perl, .net
forums, and ftp forums..

Please help us:

code
Friend Sub ftpfile()

Dim sFTPSrcFileName As String
Dim sFTPTgtFileName As String

' For testing purpose we have hard-coded the input file
sFTPSrcFileName = "D:\446224_2_thumb.jpg"
sFTPTgtFileName = "sample1.jpg"
Dim sURL As String
sURL = "ftp://ftp.mysite.com"
Inet1.Protocol = icFTP
Inet1.RequestTimeout = 60
Inet1.RemotePort = 21
Inet1.AccessType = icDirect
Inet1.URL = "ftp://ftp.mysite.com"
Inet1.UserName = "myusername"
Inet1.Password = "mypassword"
Inet1.Execute , "PUT" & sFTPSrcFileName & " " &
"/httpdocs/myfile/images/imgupld/" &sFTPTgtFileName

Me.WaitForResponse
Inet1.Execute sURL, "CLOSE"
Me.WaitForResponse

End Sub

Friend Sub WaitForResponse()

Dim fWait As Boolean

On Error GoTo ErrHandler

fWait = True
Do Until fWait = False
DoEvents
fWait = Inet1.StillExecuting
Loop

ErrHandler:
Err.Clear
End Sub

Private Sub Command1_Click()
Form1.ftpfile
Timer1.Enabled = True
Set Form1 = Nothing
Unload Me
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error Resume Next

Select Case State
Case icNone
Case icResolvingHost: Me.lblRESPONSE.Caption = "Resolving Host"
Case icHostResolved: Me.lblRESPONSE.Caption = "Host Resolved"
Case icConnecting: Me.lblRESPONSE.Caption = "Connecting..."
Case icConnected: Me.lblRESPONSE.Caption = "Connected"
Case icResponseReceived: Me.lblRESPONSE.Caption = "Transferring File..."
Case icDisconnecting: Me.lblRESPONSE.Caption = "Disconnecting..."
Case icDisconnected: Me.lblRESPONSE.Caption = "Disconnected"
Case icError: MsgBox "Error:" & Inet1.ResponseCode & " " & Inet1.ResponseInfo
Case icResponseCompleted: Me.lblRESPONSE.Caption = "Process Complete."

End Select

Me.lblRESPONSE.Refresh

Err.Clear
End Sub
Sep 27 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
The forums we posted on:
http://forums.devshed.com/t291783/s.html

http://forums.devshed.com/t291774/s.html

http://forums.devshed.com/t291765/s.html

http://forums.devshed.com/t291765/s.html
JGBNS wrote:
Hi,

I am new to this forumand I apologize as i am not a .net programmer but we
have a program being developed by a .net programmer. Nowwe have run into an
ftp snag and I think it is part ftp and part .net coding.

Heres the issue..

We have an image directory full of photos like 200,000 in it, and if you use
an ftp client to ftp to the site and then navagate to that file it will try
to read it / open it. Well of course it will time out and I understand that.
Now if i drag an image from my PC in the ftp client and drop it on top the
folder with the images it saves it there fine no error or timeout.

So our program will be uploading images to this dir and we need to have it
save the image to this dir and not open or read it just save the file to it.
Below is the code being used for the image upload and it still times out it
is obvious it is trying to read the file first.

Two questions is there an alternate way to ftp, a different command maybe..

Or better yet another way to get images from the users computer using this
program to our server??

Open to all ideas willing to pay for a fix / work around.

Code below and other forums we posted this on please review all data and
other forums we have put this on perl forums because our site uses perl, .net
forums, and ftp forums..

Please help us:

code

Friend Sub ftpfile()

Dim sFTPSrcFileName As String
Dim sFTPTgtFileName As String

' For testing purpose we have hard-coded the input file
sFTPSrcFileName = "D:\446224_2_thumb.jpg"
sFTPTgtFileName = "sample1.jpg"
Dim sURL As String
sURL = "ftp://ftp.mysite.com"
Inet1.Protocol = icFTP
Inet1.RequestTimeout = 60
Inet1.RemotePort = 21
Inet1.AccessType = icDirect
Inet1.URL = "ftp://ftp.mysite.com"
Inet1.UserName = "myusername"
Inet1.Password = "mypassword"
Inet1.Execute , "PUT" & sFTPSrcFileName & " " &
"/httpdocs/myfile/images/imgupld/" &sFTPTgtFileName

Me.WaitForResponse
Inet1.Execute sURL, "CLOSE"
Me.WaitForResponse

End Sub

Friend Sub WaitForResponse()

Dim fWait As Boolean

On Error GoTo ErrHandler

fWait = True
Do Until fWait = False
DoEvents
fWait = Inet1.StillExecuting
Loop

ErrHandler:
Err.Clear
End Sub

Private Sub Command1_Click()
Form1.ftpfile
Timer1.Enabled = True
Set Form1 = Nothing
Unload Me
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error Resume Next

Select Case State
Case icNone
Case icResolvingHost: Me.lblRESPONSE.Caption = "Resolving Host"
Case icHostResolved: Me.lblRESPONSE.Caption = "Host Resolved"
Case icConnecting: Me.lblRESPONSE.Caption = "Connecting..."
Case icConnected: Me.lblRESPONSE.Caption = "Connected"
Case icResponseReceived: Me.lblRESPONSE.Caption = "Transferring File..."
Case icDisconnecting: Me.lblRESPONSE.Caption = "Disconnecting..."
Case icDisconnected: Me.lblRESPONSE.Caption = "Disconnected"
Case icError: MsgBox "Error:" & Inet1.ResponseCode & " " & Inet1.ResponseInfo
Case icResponseCompleted: Me.lblRESPONSE.Caption = "Process Complete."

End Select

Me.lblRESPONSE.Refresh

Err.Clear

End Sub

Sep 27 '05 #2

P: n/a
Hi,

First off, if you want to pay someone, you are free to use sites like
'rentacoder.com'. Service here is provided free.

Secondly, you do not have to use FTP. You can write an aspx web page that
will recieve the file, and you can have an html web page that provides a
'browse' button, collects the name of a local file, and posts it to the aspx
page on the server.

An example is here:
http://support.microsoft.com/default...b;en-us;323245

Normally, if you use a file system for storing large amounts of data, you
may want to have the receiving side move the files into subdirectories based
on some file attribute (like date, size, or id of the submitting user).

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"JGBNS via DotNetMonster.com" <u14341@uwe> wrote in message
news:5500911db94d1@uwe...
Hi,

I am new to this forumand I apologize as i am not a .net programmer but we
have a program being developed by a .net programmer. Nowwe have run into
an
ftp snag and I think it is part ftp and part .net coding.

Heres the issue..

We have an image directory full of photos like 200,000 in it, and if you
use
an ftp client to ftp to the site and then navagate to that file it will
try
to read it / open it. Well of course it will time out and I understand
that.
Now if i drag an image from my PC in the ftp client and drop it on top the
folder with the images it saves it there fine no error or timeout.

So our program will be uploading images to this dir and we need to have it
save the image to this dir and not open or read it just save the file to
it.
Below is the code being used for the image upload and it still times out
it
is obvious it is trying to read the file first.

Two questions is there an alternate way to ftp, a different command
maybe..

Or better yet another way to get images from the users computer using this
program to our server??

Open to all ideas willing to pay for a fix / work around.

Code below and other forums we posted this on please review all data and
other forums we have put this on perl forums because our site uses perl,
.net
forums, and ftp forums..

Please help us:

code
Friend Sub ftpfile()

Dim sFTPSrcFileName As String
Dim sFTPTgtFileName As String

' For testing purpose we have hard-coded the input file
sFTPSrcFileName = "D:\446224_2_thumb.jpg"
sFTPTgtFileName = "sample1.jpg"
Dim sURL As String
sURL = "ftp://ftp.mysite.com"
Inet1.Protocol = icFTP
Inet1.RequestTimeout = 60
Inet1.RemotePort = 21
Inet1.AccessType = icDirect
Inet1.URL = "ftp://ftp.mysite.com"
Inet1.UserName = "myusername"
Inet1.Password = "mypassword"
Inet1.Execute , "PUT" & sFTPSrcFileName & " " &
"/httpdocs/myfile/images/imgupld/" &sFTPTgtFileName

Me.WaitForResponse
Inet1.Execute sURL, "CLOSE"
Me.WaitForResponse

End Sub

Friend Sub WaitForResponse()

Dim fWait As Boolean

On Error GoTo ErrHandler

fWait = True
Do Until fWait = False
DoEvents
fWait = Inet1.StillExecuting
Loop

ErrHandler:
Err.Clear
End Sub

Private Sub Command1_Click()
Form1.ftpfile
Timer1.Enabled = True
Set Form1 = Nothing
Unload Me
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error Resume Next

Select Case State
Case icNone
Case icResolvingHost: Me.lblRESPONSE.Caption = "Resolving Host"
Case icHostResolved: Me.lblRESPONSE.Caption = "Host Resolved"
Case icConnecting: Me.lblRESPONSE.Caption = "Connecting..."
Case icConnected: Me.lblRESPONSE.Caption = "Connected"
Case icResponseReceived: Me.lblRESPONSE.Caption = "Transferring File..."
Case icDisconnecting: Me.lblRESPONSE.Caption = "Disconnecting..."
Case icDisconnected: Me.lblRESPONSE.Caption = "Disconnected"
Case icError: MsgBox "Error:" & Inet1.ResponseCode & " " &
Inet1.ResponseInfo
Case icResponseCompleted: Me.lblRESPONSE.Caption = "Process Complete."

End Select

Me.lblRESPONSE.Refresh

Err.Clear
End Sub

Sep 28 '05 #3

P: n/a
You don't define what INET is. What component or object are you using
to manage the ftp?

I use a c# ftp library (its open sourced and available on the Internet)
to do a whole host of ftp related automated tasks and it works just fine.
JGBNS via DotNetMonster.com wrote:
Hi,

I am new to this forumand I apologize as i am not a .net programmer but we
have a program being developed by a .net programmer. Nowwe have run into an
ftp snag and I think it is part ftp and part .net coding.

Heres the issue..

We have an image directory full of photos like 200,000 in it, and if you use
an ftp client to ftp to the site and then navagate to that file it will try
to read it / open it. Well of course it will time out and I understand that.
Now if i drag an image from my PC in the ftp client and drop it on top the
folder with the images it saves it there fine no error or timeout.

So our program will be uploading images to this dir and we need to have it
save the image to this dir and not open or read it just save the file to it.
Below is the code being used for the image upload and it still times out it
is obvious it is trying to read the file first.

Two questions is there an alternate way to ftp, a different command maybe..

Or better yet another way to get images from the users computer using this
program to our server??

Open to all ideas willing to pay for a fix / work around.

Code below and other forums we posted this on please review all data and
other forums we have put this on perl forums because our site uses perl, .net
forums, and ftp forums..

Please help us:

code
Friend Sub ftpfile()

Dim sFTPSrcFileName As String
Dim sFTPTgtFileName As String

' For testing purpose we have hard-coded the input file
sFTPSrcFileName = "D:\446224_2_thumb.jpg"
sFTPTgtFileName = "sample1.jpg"
Dim sURL As String
sURL = "ftp://ftp.mysite.com"
Inet1.Protocol = icFTP
Inet1.RequestTimeout = 60
Inet1.RemotePort = 21
Inet1.AccessType = icDirect
Inet1.URL = "ftp://ftp.mysite.com"
Inet1.UserName = "myusername"
Inet1.Password = "mypassword"
Inet1.Execute , "PUT" & sFTPSrcFileName & " " &
"/httpdocs/myfile/images/imgupld/" &sFTPTgtFileName

Me.WaitForResponse
Inet1.Execute sURL, "CLOSE"
Me.WaitForResponse

End Sub

Friend Sub WaitForResponse()

Dim fWait As Boolean

On Error GoTo ErrHandler

fWait = True
Do Until fWait = False
DoEvents
fWait = Inet1.StillExecuting
Loop

ErrHandler:
Err.Clear
End Sub

Private Sub Command1_Click()
Form1.ftpfile
Timer1.Enabled = True
Set Form1 = Nothing
Unload Me
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error Resume Next

Select Case State
Case icNone
Case icResolvingHost: Me.lblRESPONSE.Caption = "Resolving Host"
Case icHostResolved: Me.lblRESPONSE.Caption = "Host Resolved"
Case icConnecting: Me.lblRESPONSE.Caption = "Connecting..."
Case icConnected: Me.lblRESPONSE.Caption = "Connected"
Case icResponseReceived: Me.lblRESPONSE.Caption = "Transferring File..."
Case icDisconnecting: Me.lblRESPONSE.Caption = "Disconnecting..."
Case icDisconnected: Me.lblRESPONSE.Caption = "Disconnected"
Case icError: MsgBox "Error:" & Inet1.ResponseCode & " " & Inet1.ResponseInfo
Case icResponseCompleted: Me.lblRESPONSE.Caption = "Process Complete."

End Select

Me.lblRESPONSE.Refresh

Err.Clear
End Sub

Sep 28 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.