Android Question Download always emty with GetInputStream

Discussion in 'Android Questions' started by schimanski, Jun 5, 2015.

  1. schimanski

    schimanski Well-Known Member Licensed User

    I want to dowload different files from my fileserver. It work very well, but when I try to save the file with GetInputStream, the files are always emty???

    Code:
    Sub JobDone(j As HttpJob)
       
    If j.Success Then
         
    If j.JobName="download" Then
           
    Dim out As OutputStream
           out.InitializeToBytesArray(
    100)
           
    File.OpenOutput(File.DirRootExternal, "test.db"False)
           
    File.Copy2(j.GetInputStream, out)
           out.Close
           
    ToastMessageShow("Download abgeschlossen:"False)  
         
    end if
        
    else
          .....
    Thanks for help...
     
  2. LucaMs

    LucaMs Expert Licensed User

    File.OpenOutput returns the OutputStream on which you can write.

    out = File.OpenOutput(File.DirRootExternal, "test.db", False)
     
    DonManfred and schimanski like this.
  3. schimanski

    schimanski Well-Known Member Licensed User

    Jo....that's it....thanks
     
Loading...