P phukol Active Member Licensed User Longtime User Feb 4, 2014 #1 Hi guys. im using HTTPUTils2 to download my PDF. Its able to download but all the doanloaded pdf files cannot be opened because they are corrupted. my code is: ProgressDialogShow("Downloading PDF...") Dim job1 As HttpJob job1.Initialize("downloadPDF", Me) job1.Download(url) to open the file i use : File.Copy2(Job.GetInputStream, File.OpenOutput(File.DirRootExternal, strOpenFile, False)) Dim In As InputStream In = File.OpenInput(File.DirRootExternal , strOpenFile) OpenPDF In.Close i tried opening the downloaded files using desktop pdf app but it also says theyre corrupted. i also notice that the file size sis smaller then the actual file size of the working pdf.
Hi guys. im using HTTPUTils2 to download my PDF. Its able to download but all the doanloaded pdf files cannot be opened because they are corrupted. my code is: ProgressDialogShow("Downloading PDF...") Dim job1 As HttpJob job1.Initialize("downloadPDF", Me) job1.Download(url) to open the file i use : File.Copy2(Job.GetInputStream, File.OpenOutput(File.DirRootExternal, strOpenFile, False)) Dim In As InputStream In = File.OpenInput(File.DirRootExternal , strOpenFile) OpenPDF In.Close i tried opening the downloaded files using desktop pdf app but it also says theyre corrupted. i also notice that the file size sis smaller then the actual file size of the working pdf.
Erel B4X founder Staff member Licensed User Longtime User Feb 4, 2014 #2 Please use [ code ] [ /code ] tags (without spaces) when posting code. Code: Copy Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, strOpenFile, False)) File.Copy2(Job.GetInputStream, out) out.Close '<------ Upvote 0
Please use [ code ] [ /code ] tags (without spaces) when posting code. Code: Copy Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, strOpenFile, False)) File.Copy2(Job.GetInputStream, out) out.Close '<------
P phukol Active Member Licensed User Longtime User Feb 4, 2014 #3 Thanks Erel, its working now Upvote 0