Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[Bug]FilePicker in xamarin.essential not working #1723

Closed
Barshan-Mandal opened this issue Mar 10, 2021 · 9 comments
Closed

[Bug]FilePicker in xamarin.essential not working #1723

Barshan-Mandal opened this issue Mar 10, 2021 · 9 comments
Labels
need-more-information Need more information to investigate a bug or proposal unable-to-reproduce Unable to reproduce issue.

Comments

@Barshan-Mandal
Copy link

FilePicker in xamarin.essential not working
image

@Barshan-Mandal Barshan-Mandal changed the title FilePicker in xamarin.essential not working [bug]FilePicker in xamarin.essential not working Mar 16, 2021
@Barshan-Mandal Barshan-Mandal changed the title [bug]FilePicker in xamarin.essential not working [Bug]FilePicker in xamarin.essential not working Mar 16, 2021
@Barshan-Mandal
Copy link
Author

  Name Value Type
$exception {System.IO.DirectoryNotFoundException: Could not find a part of the path "/2203693cc04e0be7f4f024d5f9499e13/bb257b564d0140b69252fd25cfa7c064/file-sample_150kB.pdf". at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00177] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.IO/FileStream.cs:223 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.IO/FileStream.cs:96 at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int) at System.IO.File.Create (System.String path, System.Int32 bufferSize) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.IO.FileSystem/src/System/IO/File.cs:91 at System.IO.File.Create (System.String path) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.IO.FileSystem/src/System/IO/File.cs:83 at Xamarin.Essentials.FileSystem.CacheContentFile (Android.Net.Uri uri) [0x0008f] in D:\a\1\s\Xamarin.Essentials\FileSystem\FileSystem.android.cs:252 at Xamarin.Essentials.FileSystem.EnsurePhysicalPath (Android.Net.Uri uri, System.Boolean requireExtendedAccess) [0x00034] in D:\a\1\s\Xamarin.Essentials\FileSystem\FileSystem.android.cs:87 at Xamarin.Essentials.FilePicker+<>c__DisplayClass2_0.g__OnResult|0 (Android.Content.Intent intent) [0x0003c] in D:\a\1\s\Xamarin.Essentials\FilePicker\FilePicker.android.cs:50 at Xamarin.Essentials.IntermediateActivity.OnActivityResult (System.Int32 requestCode, Android.App.Result resultCode, Android.Content.Intent data) [0x00035] in D:\a\1\s\Xamarin.Essentials\Platform\Platform.android.cs:398 --- End of stack trace from previous location where exception was thrown --- at Xamarin.Essentials.FilePicker.PlatformPickAsync (Xamarin.Essentials.PickOptions options, System.Boolean allowMultiple) [0x0013e] in D:\a\1\s\Xamarin.Essentials\FilePicker\FilePicker.android.cs:56 at Atik_Last_Sure.AppShell.MenuItem_Clicked (System.Object sender, System.EventArgs e) [0x0002c] in F:\Atik Last Sure\Atik Last Sure\AppShell.xaml.cs:26 } System.IO.DirectoryNotFoundException

@jamesmontemagno
Copy link
Collaborator

I am unable to reproduce this locally.

@jamesmontemagno jamesmontemagno added need-more-information Need more information to investigate a bug or proposal unable-to-reproduce Unable to reproduce issue. labels Apr 13, 2021
@Barshan-Mandal
Copy link
Author

May I send you the source code?

@jamesmontemagno
Copy link
Collaborator

jamesmontemagno commented Apr 14, 2021

If you can upload it to a github repo that would be ideal.

@Barshan-Mandal
Copy link
Author

Barshan-Mandal commented Apr 14, 2021

But github doesn't allow to upload a file more than 25 mb.please download it from google drive
"https://drive.google.com/drive/folders/1o6JQg13PSMdZHHu08_rnl8zA6Q19b02j?usp=sharing"

@jamesmontemagno
Copy link
Collaborator

Add a gitignore file to your root directly and then sync it with github.

https://github.com/xamarin/Essentials/blob/main/.gitignore

@Barshan-Mandal
Copy link
Author

Barshan-Mandal commented Apr 15, 2021

https://github.com/Barshan-Mandal/Problem-In-Code
Here is the code

@softlion
Copy link

Use fileData.OpenReadAsync(), don't use FullPath

@jfversluis
Copy link
Member

This seems to be resolved 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need-more-information Need more information to investigate a bug or proposal unable-to-reproduce Unable to reproduce issue.
Projects
None yet
Development

No branches or pull requests

4 participants