Comments (5)
Okay thanks for reporting, I'll look into it asap.
from file_saver.
@creativecreatorormaybenot Can you give more details? I tested it just now and it's working fine.
from file_saver.
@incrediblezayed I am currently not running the project anymore (granted I opened this issue 2 months ago). So if noone can reproduce it, I presume you can close it for now. I would let you know if I experience it again.
from file_saver.
@creativecreatorormaybenot really sorry for delayed responsible, I was busy with sone tests.
from file_saver.
@incrediblezayed is it solved its not working for me on windows
var bytes=excel.encode();
await storeFileAsBytes(Uint8List.fromList(bytes??[]),'xlsx',MimeType.MICROSOFTEXCEL,context,);
`Future<bool> storeFileAsBytes(Uint8List bytes, String fileFormat, MimeType type,BuildContext context,{String? fileCustomName}) async {
try {
pprint('file url = $bytes');
String filename=generateTimeStampString();
if(fileCustomName!=null){
filename=fileCustomName;
}
if(kIsWeb){
var result = await FileSaver.instance
.saveFile('$filename', bytes, fileFormat, mimeType: type);
pprint(result, 2);
}else if (Platform.isAndroid ||
Platform.isIOS) {
var result = await FileSaver.instance
.saveAs('$filename', bytes, fileFormat,type);
pprint(result, 2);
} else {
var result = await FileSaver.instance
.saveFile('$filename', bytes, fileFormat, mimeType: type);
pprint(result, 2);
String path = filename;
path = 'Dowload/' + path;
await showSimpleDialog(context: context,title: 'SuccessFully! Downloaded',content: "$path");
}
return true;
} catch (e) {
pprint('for web');
pprint(e);
pprint(e);
await showSimpleDialog(context: context,title: 'Something Went Wrong!');
return false;
}
}
//get current date as random string to save file
String generateTimeStampString(){
DateTime today = new DateTime.now();
String dateSlug ="${today.year.toString()}-${today.month.toString().padLeft(2,'0')}-${today.day.toString().padLeft(2,'0')} ${today.hour.toString()}:${today.minute.toString()}:${today.second.toString()}:${today.microsecond.toString()}";
return dateSlug;
}`
from file_saver.
Related Issues (20)
- Download file without extension HOT 8
- Headers for download HOT 2
- Error on debugging HOT 1
- Update http package HOT 5
- how to save images and videos to Gallery on Android and iOS HOT 4
- Repeated extension when using `saveAs` with `MimeType.other` on iOS HOT 1
- the discord invite link is disabled HOT 2
- Custom MimeType not working HOT 9
- [proposition] memory issue, use file.copy instead of converting to byte list and back HOT 4
- Update to Gradle 8 HOT 5
- android file export error HOT 2
- [Android] No return value when use saveAs and press back HOT 5
- UnimplementedError (UnimplementedError: Unimplemented Error) HOT 4
- Handling Api Error status in LinkDetails HOT 2
- Unresolved reference: FileUtils HOT 2
- Build fails with: invalid source release: 17 HOT 31
- Can't save / download on web
- Crash caused by `java.lang.IllegalStateException: Reply already submitted error` HOT 1
- Inquiry about target platform requirements for windows HOT 1
- `saveAs` allows only for saving in Downloads directory HOT 2
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 file_saver.