- Hii...
- i made a excel file using php and after making it i added code
to download it. i get error at following line.
- and the error is like this
- I gave permission to access internal storage.
- so how can i solve the error.
- my full code is given below
- i made a excel file using php and after making it i added code
to download it. i get error at following line.
B4X:
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, FileName, False)
- and the error is like this
B4X:
java.io.FileNotFoundException: /storage/emulated/0/file.xlsx: open failed: EPERM (Operation not permitted)
at libcore.io.IoBridge.open(IoBridge.java:492)
at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:449)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
- I gave permission to access internal storage.
- so how can i solve the error.
- my full code is given below
B4X:
Dim j As HttpJob
j.Initialize("", Me)
j.Download("http://mysitename/")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.Tag)
Log(j.GetString)
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, FileName, False)
File.Copy2(j.GetInputStream, out)
out.Close
Else
Dim rerror As String
Log("Error: " & j.ErrorMessage)
rerror="Error: " & j.ErrorMessage
rerror=rerror.Length
Log(rerror)
MsgboxAsync("Please connect to internet","Message")
Return
End If
j.Release