|
-
Dec 9th, 2009, 10:19 PM
#1
Thread Starter
Member
Uploading a blank file
It seems that when the timer reaches the 60 seconds mark and goes to upload the file, It's uploading it as a blank text and I'm not understanding why.
Code:
Private Sub Timer3_Timer()
Inet1.Execute , "PUT C:\Windows\log.txt /" & "/logs/" & "logs.txt"
End Sub
I've checked in my windows folder to make sure log.txt exists and it does.
At first, I was thinking it was the "\" at the end but when I take it away, No file will even appear in my FTP.
but when I have the slash there, It'll upload a logs.txt but it's blank.
I've looked into the "Log.txt" in my windows folder and it is saying 7kb.
I'm not understanding the issue here...
-
Dec 10th, 2009, 01:57 AM
#2
Re: Uploading a blank file
If you are using Vista or Windows 7, you may have a permissions issue. Try uploading a file that is in a user folder, if that still fails we can know it is not a permission issue but something else.
-
Dec 10th, 2009, 10:08 AM
#3
Thread Starter
Member
Re: Uploading a blank file
 Originally Posted by Merri
If you are using Vista or Windows 7, you may have a permissions issue. Try uploading a file that is in a user folder, if that still fails we can know it is not a permission issue but something else.
Thank for very much.
I'll have my program relocate the logs.txt to C:\users after I get home from college and see how that goes.
and yes, It is running on windows vista. I've yet to test it on XP.
I also have the UAC turned off on my laptop that I'm building this on.
Wouldn't the permission issue be gone if the UAC is turned off?
Either way, I'll move the log to another location and try that.
Last edited by Endorphine; Dec 10th, 2009 at 10:16 AM.
-
Dec 10th, 2009, 04:20 PM
#4
Thread Starter
Member
Re: Uploading a blank file
 Originally Posted by Merri
If you are using Vista or Windows 7, you may have a permissions issue. Try uploading a file that is in a user folder, if that still fails we can know it is not a permission issue but something else.
Alright, I tried that and located the log elsewhere and still the same thing.
this time I changed my inet code
Code:
Inet1.Execute , "PUT ""C:\Users\errors.txt"" errors_" & Format$(Now, "YYYY-MM-DD") & ".txt"
This is the txt file before upload

this is the text file once uploaded to FTP

Still a blank text...
Just getting on my nerves....
Last edited by Endorphine; Dec 10th, 2009 at 04:42 PM.
-
Dec 11th, 2009, 12:23 AM
#5
Re: Uploading a blank file
C:\Users is a protected folder just like C:\Windows is, because it is a system folder. A folder such as C:\Users\Username\Documents or C:\Users\Username\AppData\Local\Name Of Your Program work better. You should introduce yourself to Windows coding guidelines. There is also several VB6 code examples available on how to get these folders. See Where should I store the files that my program uses/creates?
Anyway, you're doing the testing the hard way: simply try uploading any text file from a proper user folder to see if it works or not. If it does then you can modify your code to work with that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|