In flex 3 web application how to set default save location for images?
Thanks.
From the FileReference documentation:
The FileReference and FileReferenceList classes do not let you set the default file location for the dialog box that the browse() or download() methods generate. The default location shown in the dialog box is the most recently browsed folder, if that location can be determined, or the desktop. The classes do not allow you to read from or write to the transferred file. They do not allow the SWF file that initiated the upload or download to access the uploaded or downloaded file or the file's location on the user's disk.
If you're using AIR, you have more control using the File class.
Related
I have a exe file I want to download, using a url.
I'm using the File class and calling the download(url) function to download the file.
This lets me choose a place to download the file, but the default is either the path of the application directory or the last place the user choose to save a file. This sometimes causes problems because the user will try to save it to their application directory, but we don't allow them to have write access to the folder.
I want to be able to set the default to somewhere like the downloads folder. Is there a work around to achieve this?
update: Actually i found the answer. you just place the path in the file creation. var file:File = new File("path");
I'm guessing you meant to ask about the FileReference class because the File class doesn't have a download function.
From the asdoc on FileReference:
The FileReference and FileReferenceList classes do not let you set the default file location for the dialog box that the browse() or download() methods generate
How can I browse to a file and send file location to the backend using FileReference object?
I am using flex 3.6.
Due to security purposes; you cannot get the file location using FileReference in a browser based app; you can only get the file name.
Is there a way to get the select file dialog box open and putting the location of the file into a textbox without ever uploading the file?
ETA I'm using VB.NET in a web page. By using the asp:fileupload tag I can get the file location
_fudFileLocation.PostedFile.FileName_
But how do I prevent the file from being uploaded at all. We don't need it, just the file location. (The files are on a shared drive so if it's M:\documents\todayslunch.pdf for person A, it's the same for person B.)
You do not get access to the full filepath in the browser because of security.
If this was possible, one could get the full layout of the computer of anyone going to any website.
System.Web.HttpPostedFile.FileName gets the fully qualified name of the file on the client which includes the directory path.
I have a SWF file which contains of an image (1keyframe) and also, it contains an AS3 file with the following codes:
var loader:Loader=new Loader();
var ur:URLRequest=new URLRequest("1.swf");
loader.load(ur);
addChild(loader);
I am trying to play the swf file (1.swf - an audio) while the image is being displayed. What I want to know is how will I be able to publish this project into an SWF file which can still play as expected even without the raw 1.swf file. I can publish SWF right now but when I delete the 1.swf file, my generated swf can only display the image.
If you are able to host your file 1.swf at an actual URL, you could change your AS3 code to fetch the file, over the network, from that specific URL.
I'm building a slide-show like application in Flex and I'm trying to load images dynamically. The images are in a folder outside the application folder. This is the folder structure:
/Bildvisare-debug/
Bildvisare.html
Bildvisare.swf
/Images/
01_02_01_01_B.jpg
01_02_01_01_T.JPG
I'm reading the image names from an XML file and get them with a path of ../Images/01_03_01_01_B.jpg. In my mxml-file I've got an SWFLoader named picture and I try to load the images with the following code:
this.picture.source = images[currentImg]; //E.g. ../Images/01_03_01_01_B.jpg
this.picture.load();
The problem is that the images never show up, I only get the icon for a missing image. Can anyone help?
Edit to add: I've tried this both with and without the use-network flag set to false when compiling.
I believe this is relevant to your case.
A SWF file can access one type of external resource only, either local or over a network; it cannot access both types. You determine the type of access allowed by the SWF file using the use-network flag when you compile your application. When the use-network flag is set to false, you can access resources in the local file system, but not over the network. The default value is true, which allows you to access resources over the network, but not in the local file system.
From Flex Image Control