• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

Prompt user to save or open a document from Adobe Flash, for Adobe Air application

I'm using Flash to create an Adobe Air application.  I need to create a link that when clicked will prompt the user to save or open a .doc, .ppt, or .xls file.  Just like html would if a link was directed to that file.  I'm aware that air won't launch an external file or program but is it possible to prompt the user to 'save' the file?
0
markus7878
Asked:
markus7878
  • 3
  • 2
1 Solution
 
ChristoferDutzCommented:
0
 
markus7878Author Commented:
It seem the 'fileReference' object will only allow you to point to images, .xml, or .txt files.  If referencing .docx or .ppt nothing happens
0
 
ChristoferDutzCommented:
There should be no restriction for this.
Have a look at the followin line:
file.browse(new Array(new FileFilter("Images (*.jpg, *.jpeg)", "*.jpg;*.jpeg")));

Open in new window


Simply change this to
file.browse(new Array(new FileFilter("Images (*.docx, *.ppt)", "*.docx;*.ppt")));

Open in new window


Or use it without any filter to allow any file type.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
markus7878Author Commented:
The above solution uses the 'URLrequest'
public function ImageSave() {imgFile = new URLRequest("coffee.jpg"); //change it to your image path

Open in new window

'URLrequest' will only work with image, or .pdf file when exporting flash as an air application.
When using the the 'URLrequest' and referencing a .ppt file it simply opens a blank window, in adobe air, rather than launching the application or prompting the user to save the .ppt file to their hd.
 
0
 
ChristoferDutzCommented:
Well the problem is not Flash from not loading the PPT, its simply that flash cannot display a PDF or PPT. The download works great with URLRequest.
0
 
CWS (haripriya)Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now