473,800 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

save dialogue box in flash (saving external jpg + .doc files)

1 New Member
Hi all
Im relatively new at flash, and am needing to make a "demo file" which consists of a photo album. The people viewing the album must then be able to click on an image, and this will bring up a dialogue box that will allow them to save the image they clicked on and the associated word file in a location of their choice.

I have looked at Jsystem by Flashjester, but am not sure if this is the right path to follow, as it only seems to mention .txt files, and Im needing the graphic element too.

any help would be greatly appreciated.
thanks
Jun 11 '07 #1
3 4089
xNephilimx
213 Recognized Expert New Member
Hi all
Im relatively new at flash, and am needing to make a "demo file" which consists of a photo album. The people viewing the album must then be able to click on an image, and this will bring up a dialogue box that will allow them to save the image they clicked on and the associated word file in a location of their choice.

I have looked at Jsystem by Flashjester, but am not sure if this is the right path to follow, as it only seems to mention .txt files, and Im needing the graphic element too.

any help would be greatly appreciated.
thanks
I don't know if there is a way to do that only with AS, but sure there is one with the help of the beloved php.

From that dialog box in your flash movie you should set up two links, one for the image, and one for the doc. You'll also need to have all the required files (pics and docs) in some specific folder ,like, "/files", or whatever you want. Then a php file which will handle and trigger the downloads instead of letting the browser try to open the files directly.


I'll explain the PHP file first, and then I'll tell you how to make the "trigger" links in flash.


It's a very simple php script file that only contains this:

[PHP]
<?php

//I get the name of the file from the get method array.
//the "files/" part is the folder, if the files are in the same folder, just delete this part and leave only $_GET['f'].
$thefile = "files/" . $_GET['f'];
//I define the Content-type (MIME) of the file that i'm outputting:
$mime = mime_content_ty pe($thefile);
header('Content-type: ' . $mime);
//Then I define that it will be an attachment and the new name (the original name in this case)
header('Content-Disposition: attachment; filename="' . $thefile . '"');
//And output literally the entire file, but because its disposition is defined as an attachment the browser will attemp not to show it, but to save/download it
readfile($thefi le);

?>
[/PHP]

Save this file in the same folder as the flash movie with any name you want, for sake of the example i'll call the file download.php

Now all you gotta do is define the links (buttons) in the flash movie.
All you need to do in order to trigger this links is the following line if code in your button:

For the image:
Expand|Select|Wrap|Line Numbers
  1. getURL("download.php?f=pic.jpg","_blank");
  2.  
For the doc:
Expand|Select|Wrap|Line Numbers
  1. getURL("download.php?f=thedoc.doc","_blank");
  2.  
Well, hope you find it usefull!

NOTE: The mime_content_ty pe function is available in php since PHP 4.3.0 and PHP 5. If you are using an older version of PHP that function won't work.
Jun 21 '07 #2
endline
10 New Member
very cool, though im not the person that asked the question, i have a feeling that this will be useful to me. ty for the expertise.
Jun 22 '07 #3
xNephilimx
213 Recognized Expert New Member
very cool, though im not the person that asked the question, i have a feeling that this will be useful to me. ty for the expertise.
lol. I hope so.
You're welcome.
Jun 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
6794
by: Raymond H. | last post by:
Hello, I tried the line in vb but it open the dialogue box (I'd like not to open this box; I'd like save without viewing a dialogue box). WebBrowser1.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT I'd like to save the web page in WebBrowser1 in vb, but all automaticly without open a dialogue box. I'd like to save my web pages in 'Test01.mht'. I'd like the mht format because it save the pictures in the same file. Raymond H.
7
16226
by: Martin | last post by:
Again drawing on the groups experience:- 1. For general file opening and file saving, using VB6, are there any issues with using the FileOpen and FileSave Common Dialog Boxes? 2. Is using the FileOpen and FileSave Common Dialog Boxes the best way to go in general? 3. For Most of my projects I will be using the same types of data input form and report output form, as discussed here recently. Also, the files that are
8
3888
by: tmb | last post by:
1 - Can you build an entire web page or site with Java... sorta like you can with Flash? 2 - Can you do... .. Drag & Drop .. Push Buttons .. Hot Spot .. Hot Object .. Pull Down's (combo boxs) .. data entry fields
5
6898
by: kevin | last post by:
Hi, Any help with this would be really appreciated! I'm trying to download a file from a remote server. The access permissions is okay but the problem I'm facing is that the file is getting downloaded before the Save As dialogue appears. As we will be downloading some large files, it's unpractical to have this. So far the code I have to download the file is
3
5576
by: Mike | last post by:
I have a simple flash file that plays within a webform of an asp.net app. When running from the server the flash file works fine. But when I run it from my localhost the flash file simply doesn't play. I have Flash installed on my localhost, and I'm not sure why its not working. Is there a setting somewhere in IIS or the computer's Extensions of my localhost which may be preventing it from playing? Before posting my code which...
5
1958
by: hp_1981 | last post by:
Hi Is there anyway avoiding users to save my web pages? this idea came to my mind when I tried to save a web page, but in the middle of saving progress something like the following error occurred: "unable to save the page...". on the other hand, once, I saved a web page successfully, but when I opened it the characters were completely unreadable. unfortunately I can't remember the url now but if you know any way to restrict users,
0
1275
by: sp | last post by:
Hi everyone, Just joined this group. I have a question about saving bitmap images from flash too a .NET site using VBScript. There are several tutorials showing how this can be done using php (for instance, check out <a href="http://www.flash-db.com/Tutorials/snapshot/index.php">this</a> and <a href="http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php">this</a>)
1
3347
by: MaxWall | last post by:
Hi Everyone, I'm new to the forum and to the Actionscripting world. I need some help with a project I'm working on and would appreciate any guidance. I'm working on a flash app for CD-ROM development. I'm trying to save a file from an external directory on the CD-ROM to the desktop. Is there a way to do this using the fscommand or LPFlashEx? Or something else? I've been doing some research on the latter and am trying to figure out where...
1
2396
by: billelev | last post by:
I have written some code that allows the printing of a report to a pdf file. Ideally, I would like to name the file via code and not have the pdf application prompt the user for a file name. I have been able to achieve this using Acrobat Professional (trial version). Before spending what seems to be a very large amount on a fully licensed version of Acrobat, does anyone know of a free alternative? FYI - I have looked into CutePDF, and it...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.