Hi ,
In my application, I am trying to download files with HttpUtil2. I can download them, but I don't know how to save these files with their original filename.
For example, there are three files on my http server: 1.jpg; 2.jpg; test.jpg
I create a Job to download them, but I don't know how to save them from a outstream using their original file names. Could you please advise?
a part of code like this:
For i = 0 to 2
myURL = "http://basic4app.com/my" & FileName(i) ' myFileName contains the file names that
' I want to download from server.
Job1.Download(myURL)
Next
Sub JobDone(Job As HttpJob)
Dim OutStream As OutputStream
If Job.Success = True Then
OutStream = File.OpenOutput(File.DirInternal, fileName, False)
File.Copy2(Job.GetInputStream,OutStream) ' save the file
OutStream.Close
End If
End Sub
in above sample, how can I know which filename I should use? Thanks.
Alternatively, please adivse me other way to download files and save them with the original file name in my specified folder.
In my application, I am trying to download files with HttpUtil2. I can download them, but I don't know how to save these files with their original filename.
For example, there are three files on my http server: 1.jpg; 2.jpg; test.jpg
I create a Job to download them, but I don't know how to save them from a outstream using their original file names. Could you please advise?
a part of code like this:
For i = 0 to 2
myURL = "http://basic4app.com/my" & FileName(i) ' myFileName contains the file names that
' I want to download from server.
Job1.Download(myURL)
Next
Sub JobDone(Job As HttpJob)
Dim OutStream As OutputStream
If Job.Success = True Then
OutStream = File.OpenOutput(File.DirInternal, fileName, False)
File.Copy2(Job.GetInputStream,OutStream) ' save the file
OutStream.Close
End If
End Sub
in above sample, how can I know which filename I should use? Thanks.
Alternatively, please adivse me other way to download files and save them with the original file name in my specified folder.