To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Part 10 of the Visual Basic .NET 2010 Express Tutorial Complete!
How to Use the Visual Studio Code Analysis Tool FxCop
Article :: Interview with Andrei Alexandrescu (Part 3 of 3)
Introducing Visual Studio LightSwitch
Visual Studio LightSwitch Beta 1 is Available



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Display Modes
Old Apr 25th, 2007, 09:33 PM   #1
seanwpb
Addicted Member
 
Join Date: Jun 03
Posts: 178
seanwpb is an unknown quantity at this point (<10)
Resolved [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.
seanwpb is offline   Reply With Quote
Old Apr 26th, 2007, 06:33 AM   #2
amrita
Fanatic Member
 
amrita's Avatar
 
Join Date: Jan 07
Location: Orissa,India
Posts: 622
amrita will become famous soon enough (65+)
Smile Re: FTP attached file name issue

Try this
Code:
"Put " & App.Path & "\" & strCompanyName & ".txt" & " " & "htdocs/" & strCompanyName & ".txt"
amrita is offline   Reply With Quote
Old Apr 26th, 2007, 11:58 AM   #3
seanwpb
Addicted Member
 
Join Date: Jun 03
Posts: 178
seanwpb is an unknown quantity at this point (<10)
Re: FTP attached file name issue

that code doesnt give me any errors in vb but doesnt upload anything either
seanwpb is offline   Reply With Quote
Old Apr 26th, 2007, 12:13 PM   #4
seanwpb
Addicted Member
 
Join Date: Jun 03
Posts: 178
seanwpb is an unknown quantity at this point (<10)
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.
seanwpb is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


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

Forum Jump


All times are GMT -5. The time now is 05:26 AM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.