Open cgarzacastelec opened 7 years ago
Also if you use the back button it won't let you pick andother file because "Only one operation can be active at a time"
@cgarzacastelec this invalid operation already has been fixed on current repository and to use this current repository just download and build the project and replace dll files with your existing dll of this plugin. I think your problem will be solved. Because it also solved my same problem.
The problem with the invalid operation is resolved in current repo, but for iOS, the document path and DataArray are null still.
Thanks for your replies, I downloaded the latest from the current repository but now I have this error
Plugin.FilePicker.Abstractions.FileData myData = null;
try
{
var crossFilePicker = Plugin.FilePicker.CrossFilePicker.Current;
myData = await crossFilePicker.PickFile();
if (!string.IsNullOrEmpty(myData.FilePath)) //The file path, but is all wrong "document/8BBF-19D9:test.txt"
{
foreach (byte b in myData.DataArray) //DirectoryNotFound exception found when trying to get data array
b.ToString();
}
}
catch (InvalidOperationException ex)
{
ex.ToString(); //"No longer happens but now we have... "
}
catch (DirectoryNotFoundException ex)
{
ex.ToString(); //... could not find a part of the path "document/8BBF-19D9:test.txt"
}
I will be checking to code to see if I can fix it, thanks again
Checking the code I found in IOUtil.class a TODO to handle non-primary volumes... adding the exact same code "return Android.OS.Environment.ExternalStorageDirectory + "/" + split [1];" if it is not "primary" gives me the right path of the file, anyone knows what "document/8BBF-19D9" stands for and why it isn't "primary" as the unaltered code?
Thanks for the plugin and valuable info.It is working fine in android and windows, but facing the same issue in iOS platform.The document path and DataArray are null.Can any one suggest me the solution or work around for this issue.
Thanks in advance
Hi, I followed the procedure here and it worked for me: https://github.com/Studyxnet/FilePicker-Plugin-for-Xamarin-and-Windows/issues/30
You'll have to download the repo and make the code changes described in the comments until a pull request is made and accepted for it.
@neptunecentury Thank you so much.I followed the procedure its working.
@cgarzacastelec @ShahriatHossain @neptunecentury @keannan5390 i am getting same issue in ios please help me exception thrown is :=" could not find a part of the path"
@mayur2871 I was having the same problem as you and I replaced File.OpenRead in FilePickerImplementation.cs with this:
tcs?.SetResult(new FileData(e.FilePath, e.FileName, () => { var url = new Foundation.NSUrl(e.FilePath); return new FileStream(url.Path, FileMode.Open, FileAccess.Read); }) );
Hope this helps some people out. File.OpenRead didn't work for me when fetching file from iCloud drive. I think the key may be converting first to NSUrl.
@iupchris10 Thank you this works like a charm
Anyone know when this will be fixed on the nuget?
Can someone give me the updated dll? please
System.TypeLoadException: 'Could not load type of field 'Roemichs_Test_API.ImageDocs+
I'm using the NUGet version 1.1.0 and I can use the file picker and it works fine but when I get a file the byte array is empty and the file name is only the name of the file without the path.
If only I could get the file's full path it would be great, from there I could get the byte array. I am doing something wrong? my code is like this:
var crossFilePicker = Plugin.FilePicker.CrossFilePicker.Current;
var myTask = await crossFilePicker.PickFile(); if (!string.IsNullOrEmpty(myTask.FileName)) { myTask.FileName.ToString();
}