Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Upload text file

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2008, 05:09 PM
Junior Member
 
Join Date: Jun 2008
Posts: 39
Default Upload text file

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
Reply With Quote
  #2 (permalink)  
Old 06-17-2008, 05:34 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

PUT method is not supported by all servers and you may need to first configure your server.
Maybe this page might help you: Configuring your WWW server to understand the PUT method

You can also consider using the FTP library instead.
Reply With Quote
  #3 (permalink)  
Old 06-17-2008, 05:37 PM
Junior Member
 
Join Date: Jun 2008
Posts: 39
Default Upload text file

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

AB
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to read text file. ikaplan Questions (Windows Mobile) 8 11-04-2008 03:36 PM
Coverting text files with binary file page code functionality kolbe Code Samples & Tips 1 06-21-2008 05:06 PM
Display large text file JamesC Questions (Windows Mobile) 3 03-08-2008 02:45 AM
Degree symbol in text file derez Bug Reports 3 07-06-2007 09:22 AM
open a text file with Word mwaite Questions (Windows Mobile) 6 06-16-2007 09:03 AM


All times are GMT. The time now is 07:23 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0