PDA

View Full Version : Transferring a file via HTTP


PointOfLight
05-26-2008, 02:55 AM
In part two of my series on "things I never thought I'd mess with", I have looked into how to transfer a file using HTTP.* On the plus side, I know the theory works, because I can use this to transfer a file on my local server at home.* On the down side, I haven't gotten it to work on my hosting site's server yet.* If someone can figure it out, or at least provide me with another location to try writing files to, I'd really appreciate it.* Code is attached.

[br]1211766947_49_FT0_http_file.zip

kornalius
05-26-2008, 06:52 PM
Thank you Eric, very nice post.

quangdx
05-26-2008, 07:03 PM
well running this trying to write to my website.
http://www.asobitech.com/up
gives me the following


Welcome to the PPL Console

Opening internet connection...
Connected to site...
local file: resume.htm
remote file: up/resume.htm
result$: 1, numwritten$: 
Closing file...
File transferred successfully...
Closing internet connection...



not sure what the character followed by, numwritten$: is.
but my guess the problem probably lies with permissions,
seeing as you're able to write to a local http server.
i even CHMOD the /up folder to 777 but that didn't help it seems.

PointOfLight
05-26-2008, 07:09 PM
I actually tried the chmod 777 thing as well to no avail.* I'm not sure what the deal is with the nw$ variable either.* Even when I call the program against my local server (so it works), I still get garbage in that variable, which is supposed to return the number of bytes written.* It also really urks me that the function returns true, since according to MSDN it should return false if a file isn't written.* In effect, the program thinks the file has been written even though it hasn't.* I will keep investigating to see if I can solve the problem.