Results 1 to 5 of 5

Thread: Uploading a blank file

  1. #1

    Thread Starter
    Member Endorphine's Avatar
    Join Date
    Dec 2009
    Location
    Shelby, Ohio
    Posts
    51

    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...

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    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.

  3. #3

    Thread Starter
    Member Endorphine's Avatar
    Join Date
    Dec 2009
    Location
    Shelby, Ohio
    Posts
    51

    Re: Uploading a blank file

    Quote Originally Posted by Merri View Post
    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.

  4. #4

    Thread Starter
    Member Endorphine's Avatar
    Join Date
    Dec 2009
    Location
    Shelby, Ohio
    Posts
    51

    Re: Uploading a blank file

    Quote Originally Posted by Merri View Post
    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.

  5. #5
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    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
  •  



Click Here to Expand Forum to Full Width