-
28 Nov 2012 5:25 AM #1
Unanswered: Downloading image/text file using 'iframe' and 'Ext.core.DomHelper'
Unanswered: Downloading image/text file using 'iframe' and 'Ext.core.DomHelper'
am using Extjs - 4.1.0 and I want to prompt download window. I used 'iframe'. The window gets displayed only when the file being posted is zip/mp3 but when the file being posted is text/image file, the window doesn't appear. Is there some property to be set to enable download window for text/image/different files? Please find my code below.
Thanks in advance.Code:var record = item.findParentByType('itemcontextmenu').record; Ext.Ajax.request({ url : ORT.Configuration.DOWNLOAD_GRAPHICS_URI+"&graphics="+record.get('id'), success: function (response, opt) { result = Ext.decode(response.responseText); try {Ext.destroy(Ext.get('graphicsDownloadIframe'));}catch(e) {} Ext.core.DomHelper.append(document.body, { tag: 'iframe', id:'graphicsDownloadIframe', css: 'display:none;visibility:hidden;height:0px;', src: result.fileName, frameBorder: 0, width: 0, height: 0 }); } });
-
30 Nov 2012 9:15 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3157
Sounds like the browser is trying to display the image doesn't it? Browser by default will display images. Take a url of an image and put it as the url and see what the browser does.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote