Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Upload text file


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2008, 06: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, 06:34 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
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, 06: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 On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 01:41 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0