Android Question Storage error

fishwolf

Well-Known Member
Licensed User
Longtime User
I have a error when try to copy a file under Pictures/MyApp folder

App don't create folder

i have the PERMISSION_WRITE_EXTERNAL_STORAGE permission

Thanks

<code>
Dim DestinationPath As String

DestinationPath = File.Combine(File.DirRootExternal, "Pictures/MyApp")

If File.Exists(DestinationPath, "") == False Then
File.MakeDir(File.Combine(File.DirRootExternal, "Pictures"), "MyApp")
End If

File.Copy(File.DirInternalCache, SourceFile, File.Combine(File.DirRootExternal, "Pictures/MyApp"), DestinationFile)
</code>

<code>
SourceFile=5248-0.jpg
DestinationFile=MyName.jpg
DestinationPath=/storage/emulated/0/Pictures/MyApp
java.io.FileNotFoundException: /storage/emulated/0/Pictures/MyApp/MyName.jpg: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:496)
at java.io.FileOutputStream.<init>(FileOutputStream.java:235)
</code>
 
Top