Allow users to Download documents from server

Hello Everybody,
I am working on an Flex application where I have to allow the
users to Open/Save documents such as Word document, Excel sheet,
PDFs, Jpeg, Media files (any digital format document) when a user
clicks on a link present in a Flex application. To do this I am
using the navigateToURL() method and simply passing the URL string
as a URLRequest to the navigateToURL method. This works fine but
whenenver the link is invoked and the user selects to Save the
Excel sheet or any document it displays an unwanted browser window
behind the Open/Save/Cancel dialog box saying action cancelled.
I can not use "_self" as I require the Flex application to
run as is. I tried using the javascript:window.open() but this did
not work.
1) Is there a process to stop the browser window from
opening?
2) How can we invoke a javascript using navigateToURL(), I
tried to invoke javascript.alert('Ok') and also
javascript:window.open() both did not function.
3) Is there any other method or flex classes etc. to invoke
external applications (allow to download documents from server)?
Please help me.
Thanks and Regards,
Paromita

Paromita,
You could use the file download functionality. This is from
the docs:
You can let users 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 lets you specify a default filename that
appears in the download file dialog box. If you omit the second
parameter, defaultFileName, the filename from the specified URL is
used.
The 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 default name to currentnews.xml instead of
index.xml, specify the defaultFileName parameter, as the following
snippet shows:
var request:URLRequest = new URLRequest("index.xml");
var fileToDownload:FileReference = new FileReference();
fileToDownload.download(request, "currentnews.xml");
I think this will accomplish what you are trying to do.
Vygo

Similar Messages

  • To save a word/xls document from server machine to client

    Hi Folks,
    I am facing a problem in storing a document from server to client machine.
    I have a document in Oracle database BLOB column and i am able to read and open that document in client browser. But it is stored in the server machine when accessing from the client browser it is opening as a read only copy.
    I want to open it as editable copy in client machine and once it is edited i want to save back to the databse. But it can be stored in server or client machine without promting to the user.
    Any one can help me?
    Senthil

    Hi, I am wondering whether this will take time for a document/image which is about 3, 4 MB??? Cos customer has to scan documents one by one and the saving of the file in the DB and then using that to transfer to MSMQ (which is the requirement) should take less time than scanning 2 documents.

  • BPC 5.1 - Cannot download templates from server

    Hi All,
    One of our users receives the message "unable to download templates from server" when logging on to the system.  If she clicks OK to get past the message, BPC comes up but there is no action pane.  Only one computer seems to be affected.  The same user can log on to a different computer and run BPC without a problem.  No changes (that we are aware of) were made to this computer since the last time it worked fine (last week).  We are running BPC 5.1 SP8.  What could be causing this problem?
    Thanks!

    Hi Kiran,
    I tried as you suggested but unfortunately it did not solve the problem. 
    Hi Roberto,
    I cleared the local cache on the machine and logged back in.  This seems to have resolved the problem.
    Thank you both for your help!
    Barb

  • Code for website to allow users to download free Reader

    This is not the right forum, but I couldn't find one that applies, sorry.
    I'm adding some PDF files to my website for download, and I need to find the code that I can add to my website that will allow users to download the free Reader if they don't already have it. Can someone point me to that, please?
    Thanks!

    Found it:
    http://www.adobe.com/misc/linking.html
    (related question popped up over there   --->
    which had the link.)
    I see that it's actually just the image, and there's no code... you just hyperlink the image yourself. Long time ago there used to be some HTML code that came along, and did the link for you as a reference or something.  I'm set now... thanks.

  • How do I download documents from my computer to Ipad?

    How do I download documents
    from my computer to Ipad?

    Apple has the iBooks app for compatibility with pdf flies. If you do not have it on your iPad, you can download it for free. My personal preference for pdf's is the free Adobe Reader app. It has so many more useful features than iBooks, but if all that you want to do is save the pdf's and organize them into collections, iBooks will work fine. So download an app that you can store pdf files in.
    In order to transfer pdf files to the iPad, you can do that via iTunes. If you are using iBooks on the iPad, you have to add the pdf's to your iTunes library via File>Add to Library. Then you can select them to sync to the device by selecting them in the books pane of iTunes when the iPad is connected to your computers iTunes. This explains how to add content to iTunes. It works with pdf files as described in this article.
    Adding music and other content to iTunes - Apple Support
    Sync your iPhone, iPad and iPod with iTunes using USB - Apple Support
    If you use the Adobe Reader app, you can use iTunes File Sharing to transfer the files.
    iOS: About File Sharing - Apple Support
    MS Word is now available as a free app in the App Store. Read about it here.
    https://itunes.apple.com/us/app/microsoft-word/id586447913?mt=8

  • Why doesn't apple allow you to download files from the internet like how android users can?

    I was using a friend's android phone yesterday and saw that he could download files a wide variety of files from the internet and that made me wonder why Apple doesn't allow iPhone users to download files like the ones you could on an android device

    To keep the sort of malware rather prevalent for Android devices off of your iPhone. Depending on what you need to download, though, you can probably find a third-party app that will do it. Since such apps keep their documents in their own sandbox, it helps protect the iPhone from being infected by malicious "documents".
    Regards.

  • How to set up reverse proxy to allow user access portal site from internet

    Hi all,
    I have installed 10g(10.1.2.0.2) AS on same machine(single IP for both mid and infra with different users respectively). there is a DMZ on which windows IIS is working through which we need to redirect the request to application server such that users access portal page from internet (within intranet all URLs are working fine). I have went through technet documentation where i found 3 ways : through this link
    http://download.oracle.com/docs/cd/B14099_19/core.1012/b13998/variants.htm
    Section 9.2.1.1, "Configuring OracleAS Web Cache as a Reverse Proxy"
    Section 9.2.1.2, "Configuring the Oracle HTTP Server as a Reverse Proxy"
    Section 9.2.1.3, "Configuring Internet Information Services as a Reverse Proxy"
    I am confused to which option to use. Also i went through the metalink document 270160.1
    Please help me which option to choose to do this.
    Thanks.

    Hi Hozy,
    May be it's too late, I am thinking to go in the same route for our sap portal access to external customers. Please can you share your experience , like what are the challenges have you faced? what is the complexity? what are all the resources we need to configure this?
    I appreciate your feedback.
    Thanks
    Krish

  • Does JXTA allow you to download files from multiple source like a P2P?

    I was interested in working on some networked apps using JXTA and I was wondering if JXTA allows you to download a file from multiple users (ala Bittorrent or P2P) or whether it's by a user to user basis?

    To keep the sort of malware rather prevalent for Android devices off of your iPhone. Depending on what you need to download, though, you can probably find a third-party app that will do it. Since such apps keep their documents in their own sandbox, it helps protect the iPhone from being infected by malicious "documents".
    Regards.

  • Zero Client Design - allowing user to create document like a word document

    Hi All,
    I am planning to develop an internet based application. How can i allow user to start creating a document (Let say Word document). User does not have Microsoft Word installed on his/her client computer. my application offers create new document.
    User clicks "create new" link on the page. Is it possible to lunch the word in create new page to let user to create document and at the end click Save link on the page to save it on to server?
    Is it possible to call the word application from the sever?
    Thanks
    Sam

    I've never tried it and there may be alternative ways of doing it, but I would think the only way you can provide formatting tools - without recreating each tool - is to use an Applet.
    What you're trying to do is create a document object on the server, have the user select an command on the client side (such as underlining text), have the client pass the command back to the server, and echo the results of that operation, right?
    It would be incredibly awkward and impractical to do that through a conventional stateless HTTP medium such as JSPs, PHP or JavaScript. It may have been done before, I'm just not aware of any attempts to do so.
    Are you willing to consider alternative third-party solutions, open source or not? Or is this something that you explicitly have to code?

  • Access/download file from server.

    have a problem. When I am trying to save/open a file from server(secure) which uses HTTPS, its displaying error message:
    Internet Explorer cannot download ...File_name.doc from Server_name.
    Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
    My code is below. Please help me out.
    Its working with my localhost(http) and with Firefix browser. Its something to do with http and IE 6.
    <java>
    if (!request.getScheme().equals("https"))
    response.setHeader("Pragma", "no-cache");
         String fileName=request.getParameter("instruction");
         //filename = filename.replaceAll( "\\W*", "" ) ;
         String DirName = request.getParameter("directory");
         String value = (DirName+"/"+fileName);
                   File f = new File (value);
                   response.setContentType("application/msword");
                   //set the header and also the Name by which user will be prompted to save
                   response.setHeader("Content-disposition", "attachment; filename=" + fileName);
                   InputStream in = new FileInputStream(f);
                   out.clearBuffer();          
                   int bit = 256;
                   int i = 0;
                   try {
                        while ((bit) >= 0) {
                             bit = in.read();
                             out.write(bit);
                   } catch (IOException ioe) {
                        ioe.printStackTrace(System.out);
                   out.flush();
                   out.close();
                   in.close();     
    </java>

    HI,
    To avoid redirection, Safari users are having good luck with Open DNS Free / Basic
    Carolyn

  • Downloading File from server

    I have written more or less same code like following
    to send file from server to browser in other web applications, where browser displays Save As dialog box
    to the user, but the same code doesn't work with portal.
    following code part of a page flow
    <pre>
    * @jpf:action
    * @jpf:forward name="success" path="index.jsp"
    protected Forward doUploadFile()
    HttpServletResponse res = this.getResponse();
    res.setContentType("application/x-download");
    String filename="C:\\somefile.pdf";
    File file = new File(filename);
    res.setContentLength((int)file.length());
    res.setHeader("Content-Disposition", "attachment;
    filename=" +filename);
    // Send the file.
    InputStream in=null;
    OutputStream out=null;
    try
    out = res.getOutputStream( );
    in = new BufferedInputStream(
    new FileInputStream(filename));
    byte[  ] buf = new byte[4 * 1024]; // 4K buffer
    int bytesRead;
    while ((bytesRead = in.read(buf)) != -1)
    out.write(buf, 0, bytesRead);
    finally
    if (in != null) in.close();
    if (out!= null) out.close();
    return new Forward("success");
    </pre>
    following is the JSP code to trigger the action of file
    download.
    <pre>
    <netui:form action="doUploadFile">
    <netui:button type="submit" value="Upload File" />
    </netui:form>
    </pre>
    Any clue ?

    Hi,
    Im having exactly the same problem. Did you find a way to do this.
    Thanks Chris

  • How to upload and down load Document from Server in Webdynpro Java

    Hi,
    I have to upload and download document to the server and from the server.
    The examle and the sample application which is available in SDN is not helpful as its about uploading and downloading from the application context.Please let me know how to upload/download from teh server.
    Sandip

    Hi sandip,
         I have same requirement.If u get any source please let me know.
    reagrds,
    Anuradha

  • Download Documents from DMS in xMII

    Hi,
    I need to download some documents from SAP which are maintained in DMS.
    I know there are some BAPIs like BAPI_DOCUMENT*  and I know how to use them in ABAP , ITS and webapplication server.
    But I am not able to think of how to do it in xMII.
    Can some one share the details.
    Thanks,
    Amara.

    Sam,
    I modified my transaction in order to save what exactly I am getting from SAP to xMII using an image saver action block to some folder with xxxx.xls file name.
    Just because of my curiosity I double clicked on the file that is just created by our transaction. It opened <b>PERFECTLY WELL</b> in MS Excel.
    So your question about asking to post garbled data clarified one of the two questions I have. Is the data getting corrupted while transmitted from SAP to xMII or is the data getting corrupted while transmitted from xMII to browser.
    From the above modification to transaction of saving the file to a folder and opening it in MS Excel confirmed that the data is not getting corrupted while transmitting it from SAP to xMII. From now on we have only one thing to deal with i.e. that the data from xMII to Browser.
    To confirm this, I created a test transaction with only one action block with ImageLoader and in the outgoing parameters I assigned imagedata property to transaction output property FILE. and I accessed it from browser using the below URL http://xxxx/Lighthammer/Runner?OutputParameter=FILE&Transaction=TEST_DOC_TRAN&content-type=application/x-msexcel . In this case also it is showing garbled data. Just to save you time I have send you transaction and test XLS file can be of any XLS file. Just to let you know that I have configured imageloader to load file from c:\inetpub\wwwroot\ directory.
    Let me know if I need to provide more info.
    Thanks in advance.
    Srinivas.

  • Download file from server

    Hi All,
    I am creating & storing some PDF files in a folder in the server. I want to give a link in a JSP where the user can download the files fromt he server where it is stored. There are so many ways, please some one enlighten me on this; about which is the best way to do it.. the user should be able to see the dialogue box to save or print the document..
    Thanks a million in advance
    smallpost

    Hi All,
    I am creating & storing some PDF files in a folder
    in the server. I want to give a link in a JSP where
    the user can download the files fromt he server
    where it is stored. Just give the link.
    There are so many ways, please
    some one enlighten me on this; about which is the
    best way to do it.. Just give the link.
    the user should be able to see
    the dialogue box to save or print the document..Why a dialog? Those options (print and save) are available in the Acrobat Reader plug-in.

  • DMS Error - Error occurred when I try to download document from storage.

    Hi, gurus
    I'm new to DMS and using 3rd party content server now but I faced error.
    let me explain my symtom.
    First, I created Content Rep. EL
    Document area: DMS
    storage type: HTTP content server
    Version: 0046
    (note that connection test is successful.)
    then, I created storage category , using content rep. EL
    Finally, I registered document to the content server I created, using T-CODE CV01N - Display
    but after that, i can not download the registered document from content server
    I just faced error message u2193
    File c:\temp\_IT300807.pdf could not be accessed
    However, when I select storage Cat. to DMS_C1_ST(Default DMS storage),
    I can download registered document
    I think I need to make some settings to use 3rd party content server.
    Can I know what setting is necessary to use 3rd party content server?
    if there are some documents, please give me some URL link. Thanks and regard
    Kwon

    Hi kori, I typed into CSADMIN and check my repository is running
    I'll give you detailed setting information
    ContentStorageHost: localhost
    ContentStorageName: SDB
    Storage: ContentStorage.dll
    Security: 1
    ContRepDescription: Content Repository using DMS
    driver: MaxDB
    DefaultDocProt: Blank
    Thanks and regard.

Maybe you are looking for

  • CUE giving a fast busy

    I am facing a weird issue and wondering if someone have seen this before... Plateforme is 2801 with CME 8.6, IOS 15.1 and CUE 7.4. I believe the version of CUE is compatible and should work with CME 8.6. What's happening is I get an immediate fast bu

  • Search help for Product id in SRM

    Hi , I have a requirement of changing the search help that is attached to the product id in SRM. we are using SRM7.0. Currently I see an elementary search help /SAPSRM/BBPH_PRODUCT on the webdynpro screen of shopping cart creation. This is an element

  • How to increase -Xmx for my ImageJ program using JRockit

    Hey guys, I'm a complete newbie. I need to increase the memory space to as great as possible for my program ImageJ. I have 3gigs of ram on my dual-quad-core computer. I understand that the max memory I can allocate to the jvm is 2.25gigs (75%?) Where

  • Sountrack Pro crashes on startup

    I happened to open SoundTrack Pro (1.1) today and it no longer opens. It was working last week. Since the last time I had it working I've installed BootCamp. I tried erasing the Windows partition so now it's back to a single partition and it doesn't

  • Switch to Student Discount

    Hello, I have a $10 Spotify Premium subscription right now, but I'd like to switch to a Student subscription.  I went to https://www.spotify.com/us/student/.  When I clicked "Get Premium", it took me to https://www.spotify.com/us/account/subscription