Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF absolute path is not getting #4

Open
ronak4567 opened this issue Feb 10, 2020 · 2 comments
Open

PDF absolute path is not getting #4

ronak4567 opened this issue Feb 10, 2020 · 2 comments

Comments

@ronak4567
Copy link

void receiveShare(Share shared) {
// TODO: implement receiveShare

debugPrint("Share received - $shared");

setState(() async {
  _shared = shared.path; //.toString();
  final filePath = await FlutterAbsolutePath.getAbsolutePath(_shared);
  print('FilePath: $filePath');
  
  showDialog(
    context: context,
    builder: (BuildContext context) => FileUploadDialog(
      url: filePath,
      buttonText: 'Add',
    )
  );
});

}

Result
Share received - {text: null, type: application/pdf, path: content://com.mi.android.globalFileexplorer.myprovider/external_files/CamScanner/New%20Doc%202019-12-04%2012.03.36.pdf}

its return Image file
FilePath: /data/user/0/com.depixed.fileupload/cache/IMG_1581322321796.png

@JeanChristopheMobizel
Copy link

JeanChristopheMobizel commented Oct 15, 2020

I got the same issue with a pdf file

final fileToCopy = await FlutterAbsolutePath.getAbsolutePath("content://media/external/file/1233");
print('fileToCopy: $filePath');

Result
fileToCopy: /data/user/0[my app package]/cache/IMG_1602767703689.png
Witch is an image of the first page of the pdf

@ronak4567
Copy link
Author

I got the same issue with a pdf file

final fileToCopy = await FlutterAbsolutePath.getAbsolutePath("content://media/external/file/1233");
print('fileToCopy: $filePath');

Result
fileToCopy: /data/user/0[my app package]/cache/IMG_1602767703689.png
Witch is an image of the first page of the pdf

If you have knowledge about Kotlin Language the go-to flutter/.pub-cache/hosted/pub.dartlang.org/flutter_absolute_path-1.0.6/android/src/main/kotlin/com/kasem/flutter_absolute_path folder in this FileDirectory.kt file you have to set dynamic file extension because in this set static file extension for every file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants