Skip to main content
Post Closed as "Duplicate" by blackgreen
Notice removed Authoritative reference needed by CommunityBot
Bounty Ended with no winning answer by CommunityBot

I am Using the flutter_webview_plugin Package for displaying Web Page.In On the Webpage, we had a feature to download filefiles. the logic for the Downloading File is Similar to the below code

 filename = "my-file.txt"
 content = 'any string generated by django'
 response = HttpResponse(content, content_type='text/plain')
 response['Content-Disposition'] = 'attachment;filename={0}'.format(filename) 
 print(response)
 return response

It is working fine when it is called directly in the browser but had no effect when it comes to Flutter Webview. Is there anything to be done manually to process it.? Even I am open to change the Package. I tried flutter_inappwebview also but no difference. I don't want to Launch an URL to any browser I just want to download directly from the application. is it Possiblepossible to do so?

I am Using flutter_webview_plugin Package for displaying Web Page.In the Webpage we had a feature to download file. logic for the Downloading File is Similar to below code

 filename = "my-file.txt"
 content = 'any string generated by django'
 response = HttpResponse(content, content_type='text/plain')
 response['Content-Disposition'] = 'attachment;filename={0}'.format(filename) 
 print(response)
 return response

It is working fine when it is called directly in the browser but had no effect when it comes to Flutter Webview. Is there anything to be done manually to process it. Even I am open to change the Package. I tried flutter_inappwebview also but no difference. I don't want to Launch an URL to any browser I just want to download directly from the application. is it Possible to do so?

I am Using the flutter_webview_plugin Package for displaying Web Page. On the Webpage, we had a feature to download files. the logic for the Downloading File is Similar to the below code

 filename = "my-file.txt"
 content = 'any string generated by django'
 response = HttpResponse(content, content_type='text/plain')
 response['Content-Disposition'] = 'attachment;filename={0}'.format(filename) 
 print(response)
 return response

It is working fine when it is called directly in the browser but had no effect when it comes to Flutter Webview. Is there anything to be done manually to process it? Even I am open to change the Package. I tried flutter_inappwebview also but no difference. I don't want to Launch an URL to any browser I just want to download directly from the application. is it possible to do so?

Notice added Authoritative reference needed by Varun
Bounty Started worth 100 reputation by Varun
Source Link
Varun
  • 1.9k
  • 1
  • 8
  • 11

Download Files in Flutter InAppWebview

I am Using flutter_webview_plugin Package for displaying Web Page.In the Webpage we had a feature to download file. logic for the Downloading File is Similar to below code

 filename = "my-file.txt"
 content = 'any string generated by django'
 response = HttpResponse(content, content_type='text/plain')
 response['Content-Disposition'] = 'attachment;filename={0}'.format(filename) 
 print(response)
 return response

It is working fine when it is called directly in the browser but had no effect when it comes to Flutter Webview. Is there anything to be done manually to process it. Even I am open to change the Package. I tried flutter_inappwebview also but no difference. I don't want to Launch an URL to any browser I just want to download directly from the application. is it Possible to do so?