Upload text file

Discussion in 'Questions (Windows Mobile)' started by aerohost, Jun 17, 2008.

  1. aerohost

    aerohost Member Licensed User

    Hi, I'm trying to upload a simple text file using the http method to a folder on my server which has 'write' permissions set. The following code does not produce an error, but the file does not arrive on the server. Does Anyone have any ideas?

    Tks, Adrian

    Sub Globals

    Dim dataReceived
    Dim orderText
    Dim orderString
    Dim orderLength
    Dim orderNumber
    Dim orderNumberLine
    Dim endIndex
    Dim orderFile
    Dim Buffer(4096) As byte
    End Sub

    Sub App_Start

    'create file
    FileOpen (c1,"test.txt",cWrite,,cASCII)
    FileWrite (c1,"test")
    FileClose (c1)

    'upload file
    Response.New1
    Request.New1("http://[server domain]/[server folder]/test.txt")
    Request.Method = "PUT"
    Writer.New1(Request.GetStream,true)

    FileOpen(c1,"test.txt",cRandom)
    Reader.New1(c1,true) 'Reads the local file.
    count = Reader.ReadBytes(buffer(),4096)

    Do While count > 0
    Writer.WriteBytes2(buffer(),0,count)
    count = Reader.ReadBytes(buffer(),4096)
    Loop

    FileClose (c1)
    Request.GetResponse

    'UploadFile(orderFile, URL)

    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. aerohost

    aerohost Member Licensed User

    Hi, never mind, thanks, it was a refresh issue when looking at the server folder ...

    AB
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice