Allow users to upload documents to the server

Hello everyone,

I'm working on a Flex app where I allow users to open/save documents as Word document, spreadsheet Excel, PDF, Jpeg media files (any document in digital format) when a user clicks on a link in a Flex application. To do this, I'm using the navigateToURL() method and simply by passing the URL as a URLRequest string to the navigateToURL method. It works fine but whenenver the link is called and the user chooses to save him or any Excel sheet, it displays a unwanted browser window behind the open/save/Cancel dialog box saying action cancelled.

I can't use "_self" I need to run as it is the Flex application. I tried to use the javascript:window.open() but it did not work.

(1) is there a process to prevent the open browser window?
(2) how can we invoke a javascript by using navigateToURL(), I tried to call javascript.alert ('Ok') and also javascript:window.open() both have not worked.
(3) are there other classes method or flex etc to call external applications (allow to upload documents to the server)?

Please help me.

Thank you and best regards,
Paromita

Aurélie,

You can use the file upload feature. This is the documentation:

You can allow users to download files from a server using the FileReference.Download () method, which takes two parameters: request and defaultFileName. The first parameter is the URLRequest object that contains the URL of the file to download. The second parameter is optional - it allows you to specify a default file name that appears in the download file dialog box. If you omit the second parameter, defaultFileName, the file name of the specified URL is used.

Following code downloads a file named index.xml from the same directory as the SWF document:

var request: URLRequest = new URLRequest ("index.xml");
var fileRef:FileReference = new FileReference();
fileRef.download (request);

To set the name by default currentnews.xml instead of index.xml, specify the parameter, defaultFileName, as shown in the following code snippet:

var request: URLRequest = new URLRequest ("index.xml");
var fileToDownload: FileReference = new FileReference();
fileToDownload.download (request, "currentnews.xml");

I think that it will accomplish what you're trying to do.
Vygo

Tags: Flex

Similar Questions

  • Allow users to add documents

    Hello

    I'm really new to this kind of things site... so if I posted in the wrong place, I apologize...

    I'm building a site using CS5, PHP and MYSQL.

    I am trying to find a way to allow users to add documents to the site via the Web page, they should be able to navigate (I can at least find the field of file in a form), and then attach the document they select. then have a list of attached documents, they can click on (as in the example below)

    Anyone have an idea how I could go about this?

    Thank you

    KK

    example.jpg

    It may be better for you to go to a commercial product like the one found here http://www.dmxzone.com/go?4509

    If this isn't what you want, you can learn more here http://www.php.net/manual/en/features.file-upload.php

    GRAMPS

  • How do I know when all users leave a room using the server to Server API

    What should I subscribe to with the API server to server to receive a reminder when there is no user in a room, or when all users have left a coin. On the client, I am able to look connectSession.userManager.userCollection, but is it possible to subscribe to this side Server? Also, could you tell me the name of the node/collectionNode I should be signing up too?

    Hello

    Server-side, we have by default all codes that tell you whether all users have left. You have to build this logic in your server on your own code. You must first subscribe to the collection 'UserManager' as 'UserManager' is the name of the node collection UserManager.

    Once you do this, you will get always any article that appeared on this collection in your "receiveItem" hook function

    Now, whenever you get a point on the node called "UserList" to the title of this collection, it designates a user input or output or userDescriptor of some user has been changed.

    So from any element on UserList, you can build an accounting from the list of users on your code on the server side and every time you download an item, you can check if your bookkeeping list is empty or not, and if so, there is no user in this room.

    Do the same on the client side too (you can refer to the onItemReceive function in UserManager.as).

    Hope this fixes your problem

    Thank you

    Hironmay Basu

  • Uploading images on the server

    Hi all

    My requirement is that the user enters the images and images must be uploaded to the server in the background while the user can continue to perform other tasks at the request. I would like to know what is the best way to implement a background thread that downloads images on the server. Could someone please provide me with a few entries. Thanks in advance.

    Kind regards

    S.A.Norton Stanley

    There is no problem with the background Thread.  I would recommend that you have only one Thread, containing the first element of a list persistent images to send.  Once the image has been sent to it, the Thread deletes the entry for one just sent and resumed the following.  You need good timing around the updating of the list, I use usually vector which is theoretically synchronized correctly but I'm a check anyway.

    The processing of wire has a public Add method that starts the Thread if it is not running.  The Thread stops when there is nothing in the queue.

    All this is pretty standard, I think.  But there are a few things that I think that you may need to add to this transformation to make it more robust:

    (a) you can give the user the option to delete the image once it is sent.  Indeed remember that the user could remove the image before sending it and if treatment should take care of this.

    (b) I would recommend a server component that receives Images.  You can then move the image into pieces because some methods of communication are limited by the size of the data that can be transferred to a single connection.  I would recommend breaking the image into blocks of 64 KB.  You should provide a mechanism to restart here too, so that you can return just the parts in waiting for an image after a failure.

    (c) you need to think about the question to know if the server and intermediate gateways will deal with binary data, or do you need to encode it in text (Base 64 seems to be the way to go if you do).

    (d) you should consider which allows the user to limit communication to specific connections, such as WiFi or 3 G.

    (e) you will need to be very careful about the coding of restart and recovery, so that the treatment doesn't die unexpectedly.

    Hope this is useful.  .

  • Upload files to the server

    Hello
    I want to download files (pdf, word, etc.) on the server, not a database.
    Is that when downloading a file is temporarily stored in a virtual table do not remember his name, I want to do is take the virtual table and upload to the server.
    and I just want to use a table to save a reference to this file.
    For example:
    a user downloads a file in / home / user / documents
    I downloaded the file and now the table is saved
    file name / rutaFichero (hyper text file)
    'the Uploaded document' / home / user / documents / document Uploaded

    I give you on the path / home / user / documents / document Uploaded
    and I download the file

    can we do?
    and as this would be the way?
    I'm newbies in the present, explain the easiest way possible

    Thank you

    Hello

    You must write the pl/sql code to do this.

    url suite can help you.

    http://www.DBA-Oracle.com/t_writing_blob_clob_os_file.htm

    or

    Search for 'write the blob in oracle file' in google.com

    Thank you
    Stefan Bosamiya,
    + 91 76000 23053
    http://jbosamiya.blogspot.com

  • Uploading files to the server using AMFPHP

    Hey everybody. I am building an application that allows the user to upload jpg files. For this I use AMFPHP and attempts to send a ByteArray in the php service file. But I keep getting the following errors:

    Gravity and Description path location creation time Id resource
    1061: call to a load method possibly undefined via a reference with flash .net: FileReference of static type.     MultiGallery/src/MultiGallery.mxml line 86 1271268938265 99

    Gravity and Description path location creation time Id resource
    1119: access to data of property may not set via a reference with flash .net: FileReference of static type.     MultiGallery/src/MultiGallery.mxml 93 1271268938266 100 line

    These are the lines of code generating errors:

    private void loadFile(e:Event):void

              {

    . file.addEventListener (Event.COMPLETE, uploadFileComplete);

    file.addEventListener (ProgressEvent.PROGRESS, onUploadProgress);

    file.load ();

              }

    uploadFileComplete(e:Event):void private function

              {

    var fileRef:FileReference = e.target as FileReference;

    var fileName:String;     

    byteData = fileRef.data;

    fileName = fileRef.name;

              }

    Any suggestions please?

    Thanks in advance!

    Hello

    This code is flex 4 but you can still use the routines in flex 3, if this does not work with targeting of fp 9 10 try to see if it works, I don't remember what has really changed in fp filereference 9 FP 10. The code takes the filereference data it sends to the amfphp service that records the image on the server.

    I also have another version that can resize the image before sending it, but need to test it a little.

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" viewSourceURL = minHeight "srcview/index.html" > "

    Import mx.controls.Alert;

    Import mx.rpc.events.FaultEvent;

    Import mx.rpc.events.ResultEvent;

    private var fr:FileReference = new FileReference();

    private void loadImage(): void

    {

    fr.addEventListener (Event.SELECT, selectedImage);

    fr.addEventListener (Event.COMPLETE, getImage);

    var imagesFilter:FileFilter = new FileFilter ("Images", "*.jpg, *.gif, *.png");

    Fr. Browse ([imagesFilter]);

    }

    private void selectedImage(e:Event): void

    {

    fr.removeEventListener (Event.SELECT, selectedImage);

    Fr. Load();

    }

    private void getImage(e:Event): void

    {

    fr.removeEventListener (Event.COMPLETE, getImage);

    If (fr.data.length > 0)

    {

    Uploader.localimg (fr. Data, fr. (Name)

    }

    }

    private void onFault(e:FaultEvent): void

    {

    Alert.Show (e.message.ToString (), "Error");

    }

    private void isImageUploaded(e:ResultEvent): void

    {

    Alert.Show (e.message.ToString (), "result");

    }

    ]]>

    PHP

    ===

    class upload

    {

    function uploader()

    {

    Define the methodTable for this class in the constructor

    $this-> methodTable = array)

    "Upload an image"-online (table)

    "description'-online"local to class server image. "

    'access' => 'remote '.

    )

    );

    }

    function localimg ($ba, $fname) {}

    $deffilepath = '... /... /images/full/'.$fname;

    $data = $ba-> data;

    $data = mysql_real_escape_string ($data);

    file_put_contents ($deffilepath, $data);

    return ("completed");

    }

    }

    ?>

  • Can not see my flash site when I upload it on the server. Help, please!

    I did a site in flash catalyst - and it was published as a swf file. Then, I went to filezilla and uploaded on the server. I have all the files I need on the server, including the html file that the swf is embedded. But when I look on the site of all, it shows me the background. I spoke with netfirms.com for 2 days and they tell me that it's on my end with the code.

    Other Notes:

    • It works when I discovered in the dreamweaver browser.
    • netfirms.com tells them that they need to update Flash 10.1 - what I did but still screen see purple and I have also went to 3 other computers with flash 10.1 on the computer and I always get the purple BG
    • Looks like he wants to come--looks like the clip wants to play but disappears and all you see is the purple BG
    • I also renamed the file index.html main.html (I've read is something that needs to be done)
    • Netfirms.com tells me that he can be a coding problem - but Adobe catalyst written all the code for you and her, as I said, it works when I view in the browsers - (google chrome, IE, Firefox and Safari)
    Please help me or point me in the right direction. Thank you very much in advance.


    http://www.mycpalawyer.com

    It will fail to load Main.swf

    I noticed that you do not have a main.swf

    Perhaps the file was renamed at some point.

    -Marc

  • Allow users to upload images

    How can I create a code that will allow users to download their personal images on my clients site to display in a frame?

    An unrelated question:

    Can an end flash intro and go directly to your home page or the user still needs to click to enter?

    A Flash intro or splash screen should be on your domain homepage.  Often, this is the page index.php, index.html, or index.asp. Since your index page represents the most important element of real estate on your site, intros Flash or Splash screens are not longer used b/c, they reduce the value of the content of your home page.

    Much better to have a homepage with a lot of rich content of keywords for search engines and humans to find and for users who cannot use Flash player (iPhone, iPad, iTouch...).

    To answer your question another way, if you want visitors to take to a new page at the end of the Flash video, you could program this in the last frame of your Flash (fla) using Script of Action project.   Check with the Flash Forums to learn more about this.

    Good luck with your project,

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB
    http://ALT-Web.blogspot.com

  • v1. L1.2 planning will allow transfer of 'embed documents' in the cell

    I was wondering how you guys treat the transfer problem 'embed documents' in the cells of working version to the final version.

    This bug has been fixed in v1.l1.2 planning that will allow the transfer of 'embed documents' in the cells to a more recent version. Here is some info on the fixed a bug:

    You are running in Bug 8876441 : 'CELL "DOCUMENT LEVEL' box to CHECK IS MISSING IN THE PAPER VERSION AND the COPY of the DATA PAGES. This issue will be resolved in the 11.1.2

    Waiting for patch for 11.1.1.3 or upgrade to 11.1.2 :)

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Allow users to add dynamically to the lines - data form

    Hello

    In some ways, I do not understand how to use this function to "allow users to dynamically add rows. When I check this option in the online form, where and how can a user add the lines? I understand that users with write access can do it, but I have write access, but I don't see any button Add or any possibility of adding the lines from the form online.

    Please let me know.

    Thank you

    Hello-

    Have you tried Edit > Add Row?

    Thank you!

  • Get the SIGSEGV segmentation fault when I upload images to the server

    I am gettting segmenation error when I tried to download images. I followed the link to download the images on the server http://blackberry.github.io/Cascades-Samples/imageloader.html . When I tried to download more images (for examples of 200 images) of the server I got the message as (/ base/usr/lib/qt4/lib/libQtCore.so.4.8.4@_ZN27QEventDispatcherUNIXPrivate8doSelectE6QFlagsIN10QEventLoop17ProcessEventsFlagEEP7timeval+0x11f) = 001313c mapaddr 8. REF = 00000011 bdslot is 1 error. using the above code example, I get the same problem. Please suggest me the best approach for this problem. I found that the problem with QnetworkaccessManager.

    It is very difficult to debug the application, given that the code is run from the qml. In addition, QnetworkManager basic network communication is asynchronous. the problem is mainly due to the network manager's response signal. When I try to run at a given time, I get signal mishandling by the network manager, which leads to a segmentation (which happens in image asynchronous download). now, I changed it to synchronized image download approach resloved my problem, but with little performance considerations.

    Thanks for the reply.

    Mercy lipatoff

  • Oracle APEX server requires a user name and password of the server said XDB?

    Hello

    After you install version 5.0 of the APEX and tries to access the page admin APEX with EPG, I am invited with a pop-window that asks you a user name and password for the XDB?

    Does somone has experience with it? What can be wrong in the configuration?

    Thank you in advance.

    Kind regards.

    Hello

    I found the problem.

    Is there somwthing wrong in the security settings.

    I re - run one of the steps with the right parameters of the call:

    DBMS_NETWORK_ACL_ADMIN.append_host_ace

    There is an error in the settings.

    Now, I'm working.

    Kind regards.

  • How to allow users to sign and return the forms fillable

    Hello

    I completed a form to complete with a signature box (it is a registration form) to send to the users. I got responses that say (based on the extended rights) that the form can be completed and saved but not signed or signed and completed but not recorded.

    is it possible to have the form completed, signed and returned.

    My apologies if I'm missing something really obvious.

    Thank you

    (should mention I use convert function Echosign, but some fields have javascript that is not sopported after conversion).

    It should be, since compatible with Acrobat Pro documents will be signed digitally sign digital applied right use, allowing player.

  • Allow users of readers to save the form in pdf with data

    I want to create a form that a user of adobe reader can open and save a copy as a pdf with the form data. I know that requires the reader extensions - what I can't understand is if I already have this included and how. I have LiveCycle Designer ES 8.2 - which is the download that I find myself searching LC with the reader extensions.

    Does anyone have instructions on how to do this or know if the feature is available in the version I am running?

    You can add the right to drive Extesnion to save the form with the data locally in two different ways.

    1. in Acrobat Pro allows to open the screen and under the guise of Advanced/extend in Adobe Reader will guide you through a wizard. Once the wixard is finished, save the file and use that one. This technique is limited to 500 users per license.

    2 LiveCycle Reader Extensions Server has a User Interface that best you select the rights you want. There are no imitations luser to this option.

    If you do not have to either option 1 is much simpler. You can download a trial version of Acrobat Pro and try it out.

    Paul

  • How to get the content of the outcome document of the server component

    Hello

    I want to handle it with the content of a step in the workflow document. I am able to check document check-in and any new content.

    I'm not able to get the content of the document.

    This is the skeleton of my server component:

    See section - it works OK

    service.executeService ("CHECKOUT_IMPLEMENT"); Case of document - OK

    Section GET_FILE

    service.executeServiceEx ("GET_FILE", true); Ecexuted OK, but where is the content of the file?

    How can I get content? Any byte [], InputStream?

    No data

    OutputStream out = service.getOutput ();

    No usable data

    Stream2 DataStreamWrapper = service.getDownloadStream (false);

    Code HTML, but not the content of the files

    service.getHtmlPageAsBytes ();

    Check section - it works OK

    binder.putLocal ("isFinished", "0");

    binder.putLocal ("doFileCopy", "1");

    binder.putLocal ("primaryFile", "new.pdf");

    binder.putLocal ("primaryFile:path", "/ tmp/result/new.pdf");

    service.executeService ("WORKFLOW_CHECKIN_SUB"); record new content - OK

    Thanks for any advice,

    Johny

    Try this method: http://www.redstonecontentsolutions.com/technical-blog/java-filter-retrieving-afile

    Jonathan

    http://jonathanhult.com

Maybe you are looking for

  • Return plate?

    Hi all I a 5s iPhone I purchased with T-Mobile the day of its release, it has a weird connector on the rear plate, which is which... seized it and now my scanner no longer works? Why and what is it?

  • You cannot change the location of the Web site folder

    Greetings, When I change the location of the Web sites folder in the server application by changing ' Store Site Files In: ", the files in the default location of continue to load and not those of the location, I've specified. The location, I put is

  • Some of the Satellite A660 - 11 M keyboard keys do not work

    Hello My Satellite A660 - 11 M keyboard does not work properly. Some keys type, others type the wrong letter/number.Replace the keyboard usually solves the problem? Keyboards are available for this model? Furthermore, juice was accidentally spilled o

  • Y510P idle

    -Very well, so in early January of this year I had a Y510P. I bought this cause I already knew that I would be transitioning to different places and that a desktop computer would not be practical. I intend to work with on the school, watch game, movi

  • I tried on & plus one more time, error code 80080005 continues to climb, I can't update my laptop until it comes to solve .__Can you help me please? __

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: Programs that you have problems with Vista home Error 80080005 Recent changes to the update of your computer What you have already tried