vello,
I am using following code to download file from web server using HTTPRequest and trying to save it to user selected location on phone. The code runs without any error but the file that gets saved is always of zero (0) byte.
Here is the code snippet that I am using:
Is there any mistake in the code?
Please help me here.
TIA
Yogi Yang
I am using following code to download file from web server using HTTPRequest and trying to save it to user selected location on phone. The code runs without any error but the file that gets saved is always of zero (0) byte.
Here is the code snippet that I am using:
nFID is int
HTTPRequest("[xxxxxxxx.com]; + gsFileName)
sResult is Buffer = HTTPGetResult(httpResult)
IF Position(sResult,"404") THEN
Info(HTMLToText(sResult)) // or some other error handling to indicate the file was not found
ELSE
IF Length(sResult) > 0 THEN
nFID = fCreate(gsParentPath+gsFileName)
IF nFID > 0 THEN
Info(fWrite(nFID,sResult,Length(sResult)))
END
END
END
Info("File Saved")
Close()
Is there any mistake in the code?
Please help me here.
TIA
Yogi Yang