[RESOLVED] FTP attached file name issue
if can send with ftp to my site files using this with no prob
Code:
With Inet1
.URL = "ftp://mysite.com"
.UserName = "username"
.Password = "password"
.Execute , "PUT c:\log.txt htdocs/log.txt"
End With
i create a text file in the apps dir like this
Code:
filenumber = FreeFile
Open App.Path & "\" & strCompanyName & ".txt" For Output As #filenumber
Print #filenumber, "Date: " & Date
Print #filenumber, "Name: " & strCompanyName
Print #filenumber, "Address: " & strCompanyAddress
Print #filenumber, "City, ST, Zip: " & strCompanyCity & ", " & strCompanyState & " " & strCompanyZip
Print #filenumber, "County: " & strCompanyCounty
Print #filenumber, "Phone: " & strCompanyPhone
Print #filenumber, "Fax: " & strCompanyFax
Print #filenumber, "SDT Line 1: " & strSecurityDepositMessageLine1
Print #filenumber, "SDT Line 2: " & strSecurityDepositMessageLine2
Print #filenumber, "SDT Line 3: " & strSecurityDepositMessageLine3
Print #filenumber, "Work Order Message: " & strWorkOrderMessage
Print #filenumber, "Unit Number Label: " & Label1.Caption
Print #filenumber, "Move In Inspection Label: " & lblMoveInInspection.Caption
Print #filenumber, "Special Info Label: " & LabelMainArray(11).Caption
Print #filenumber, "Back Charge Label: " & LabelMainArray(21).Caption
Close #filenumber
I can create the file with no prob. the file name is always company name then txt as extension. now instead of the txt file having a fixed file name the file will have a name different on each users puter. so i want to use something like this but it doesnt work
Code:
.Execute , "PUT App.Path & "\" & strCompanyName & ".txt" htdocs/& strCompanyName & ".txt"
any ideas how i can ftp the txt file? strCompanyName is a string var that holds the companies name through the app and I read it in at startup with a getsettings reg call.
Re: FTP attached file name issue
Try this
Code:
"Put " & App.Path & "\" & strCompanyName & ".txt" & " " & "htdocs/" & strCompanyName & ".txt"
Re: FTP attached file name issue
that code doesnt give me any errors in vb but doesnt upload anything either
Re: FTP attached file name issue
ok i got your code working by creating the text file on the root of c drive then ftp that. it didnt work if i tried to send the file from the aps directory. thank you for your help.