Comments (9)
from open_file.
I've tried it and it's ok, this is my code
Directory tempDir = await getExternalStorageDirectory();
String filePath = "${tempDir.path}/flutter-dilidili.apk";
if(File(filePath).existsSync()){
File(filePath).deleteSync();
}
Dio dio = new Dio();
Response response = await dio.download("https://raw.githubusercontent.com/crazecoder/dilidili/master/apk/flutter-dilidili.apk", filePath,onReceiveProgress:(_c,_t){
print(_c/_t*100);
},);
final message = await OpenFile.open(filePath);
from open_file.
can you also add image_picker? That way we can see if it is the FileProvider. Without the image_picker it works for me as well.
from open_file.
It still works
Directory tempDir = await getExternalStorageDirectory();
String filePath = "${tempDir.path}/screen.png";
print(filePath);
if (File(filePath).existsSync()) {
File(filePath).deleteSync();
}
Dio dio = new Dio();
Response response = await dio.download(
"https://raw.githubusercontent.com/crazecoder/dilidili/master/screenshot/screen.png",
filePath,
onReceiveProgress: (_c, _t) {
print(_c / _t * 100);
},
);
var image = await ImagePicker.pickImage(source: ImageSource.gallery);
filePath = image.path;
print(filePath);
final message = await OpenFile.open(filePath);
from open_file.
Actually i deleted imagepicker. still same issue will look deeper where it comes from. Mby permission issue. Can you print your filePath?
from open_file.
save path
I/flutter ( 7594): /storage/emulated/0/Android/data/com.crazecoder.openfileexample/files/screen.png
open path
I/flutter ( 7594): /storage/emulated/0/Android/data/com.crazecoder.openfileexample/files/Pictures/scaled_screen.png
I chose the path "/storage/emulated/0/Android/data/com.crazecoder.openfileexample/files/screen.png", but the printed path is not, I'm not sure about the mechanism of image_picker
from open_file.
I've tried it and it's ok, this is my code
Directory tempDir = await getExternalStorageDirectory(); String filePath = "${tempDir.path}/flutter-dilidili.apk"; if(File(filePath).existsSync()){ File(filePath).deleteSync(); } Dio dio = new Dio(); Response response = await dio.download("https://raw.githubusercontent.com/crazecoder/dilidili/master/apk/flutter-dilidili.apk", filePath,onReceiveProgress:(_c,_t){ print(_c/_t*100); },); final message = await OpenFile.open(filePath);
@crazecoder getting this error after implementing above method in dio download..
**MissingPluginException(No implementation found for method open_file on channel open_file)
**
from open_file.
@crazecoder yes it's worked for me! thanks for your quick response 👍
from open_file.
Hmm, had to reinstall my ubunut, hence new flutter and vscode. Now it works for some reason .Thanks for support
from open_file.
Related Issues (20)
- Permission denied: android.permission.MANAGE_EXTERNAL_STORAGE HOT 12
- Failed to find configured root that contains ... HOT 22
- Namespace not specified.
- The file cannot be opened and there is no error message HOT 5
- open_file 3.3.2: OpenFilePlugin.java uses or overrides a deprecated API. HOT 2
- not working in android 33 HOT 5
- Security: fileprovider allow access to all app files
- Localization issue with iOS modal in open_file package HOT 2
- Android 33 version not open file error HOT 1
- open_file requires MANAGE_EXTERNAL_STORAGE which is considered Dangerous HOT 5
- Add mobi and epub support. HOT 1
- A compile warning
- [Request] Add support for .ipa files like .apk files
- Keyboard become invisible when you open file with active keyboard (IOS) HOT 1
- Why OpenFile requires Multidex support?
- Cannot open file in app bundle? HOT 1
- webData isn't defined
- AGP 8 namespace issue HOT 1
- Cannot build apk
- how to load assets file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open_file.