Solved

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

Posted on 2011-02-27
7
374 Views
Last Modified: 2013-11-11
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
Comment
Question by:markus7878
  • 3
  • 2
7 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
Comment Utility
0
 

Author Comment

by:markus7878
Comment Utility
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
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:markus7878
Comment Utility
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
 
LVL 20

Expert Comment

by:ChristoferDutz
Comment Utility
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
 
LVL 16

Expert Comment

by:CWS (haripriya)
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now