Mulitple File Downloads in AIR

** EDIT **
Just tested. I was throttling the downloads to 28kbps. Think
there must be a timeout on the file functions, as when it was reset
without throttling, the file downloaded 100%. Is there a way to
reset/remove a timeout on a URLStream?
Good morning all.
I'm having trouble with a file download component I've
written. It worked fine debugging, but when testing an installed
version of the application, there seems to be a problem with the
loop, and files not completely downloading.
I have tested, and one file in the loop is writing to the
directory (event.complete action) at about 45%.
How can I check if the total bytes downloaded is the same as
total available, and if not, force it to carry on the download for
that particular item?
The code for the page is below:
public function Update():void {
if(appModel.fileArrCol.length > 0) {
var urlReq:URLRequest = new
URLRequest(appModel.fileArrCol[0][1].toString());
trace(urlReq.url);
urlStream = new URLStream();
urlStream.addEventListener(IOErrorEvent.IO_ERROR,
onStreamError);
urlStream.addEventListener(ProgressEvent.PROGRESS,
progressHandler);
urlStream.addEventListener(Event.COMPLETE,
fileTransferHandler);
urlStream.load(urlReq);
private function fileTransferHandler(event:Event):void {
urlStream.readBytes(fileData, 0, urlStream.bytesAvailable);
var fileLoc:String = appModel.fileArrCol[0][2].toString() +
appModel.fileArrCol[0][0].toString();
var file:File =
File.applicationStorageDirectory.resolvePath(fileLoc);
var fileStream:FileStream = new FileStream();
fileStream.addEventListener(Event.CLOSE, fileClosed);
fileStream.addEventListener(IOErrorEvent.IO_ERROR,
onStreamError);
fileStream.openAsync(file, FileMode.WRITE);
fileStream.writeBytes(fileData, 0, fileData.length);
fileStream.close();
trace("File " + appModel.fileArrCol.length + ": " +
appModel.fileArrCol[0][0].toString());
private function onStreamError(event:IOErrorEvent):void{
//Alert.show("Invalid Username or Password!","Warning");
this.showCloseButton =true;
btnUpdate.visible = true;
trace(event.text);
private function progressHandler(event:ProgressEvent):void {
/* bar.setProgress( Number(event.bytesLoaded /
event.bytesTotal), 1 ); */
bar.setProgress(event.bytesLoaded,event.bytesTotal);
progLabel.text = "Downloading " +
Math.round(event.bytesLoaded / 1024) + " kb of " +
Math.round(event.bytesTotal / 1024) + " kb " +
(appModel.fileArr.length - 1) + " files remaining";
private function fileClosed(event:Event):void {
// run a progress bar or sqlite table update here
appModel.fileArrCol.removeItemAt(0);
if (appModel.fileArrCol.length > 0){
Update();
} else {
progLabel.text = "Uploads Complete";
var thisServerVersion:String =
appModel.fileDownloadServerVersion;
var thisDescription:String =
appModel.fileDownloadDescription;
var thisDownloadDate:String = appModel.fileDownloadDate;
// store the file download details within the database table
if(appModel.checkFileDownloadHistory(thisServerVersion).valueOf()
> 0) {
// a record matches the version number in the xml. do
nothing
} else {
appModel.storeFileDownloadHistory(thisServerVersion,thisDescription,thisDownloadDate);
// close the box down
PopUpManager.removePopUp(this)
public function init():void{
btnUpdate.visible = false;
this.showCloseButton = true;
if (appModel.urlAvailable){
Update();
}else{
Alert.show("No Network Connection Detected","Message");
this.showCloseButton =true;
btnUpdate.visible = true;
public function titleWindow_close(evt:CloseEvent):void {
PopUpManager.removePopUp(this)
The application reads the number of files from an xml file on
the server. That works fine, but I think the loop is wrong. In
debug, it traces the file names without a problem
Please please please can someone help me? I need to get this
sorted and resolved by this lunchtime.
Many thanks in advance,
Matt

http://kb.mozillazine.org/Unable_to_save_or_download_files
Separate Issue;
Your System Details shows;
Installed Plug-ins
Shockwave Flash 16.0 r0
Shockwave Flash 11.9 r900
Having more than one version of a program may cause issues.
Grab the uninstaller from here:
'''[http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html Uninstall Flash Player | Windows]'''
'''[http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-mac-os.html Uninstall Flash Player | Mac]'''
Then reinstall the latest version.
Flash Player '''v16.0.0.257<br>https://www.adobe.com/products/flashplayer/distribution3.html'''
Shockwave Director '''v12.1.6.156 http://get.adobe.com/shockwave/'''

Similar Messages

  • Does Air allow file downloads/transfers to desktop from inside app?

    Hello,
    I am looking into writing an air application that I intend to put onto a usb thumb drive. If a Mac or Pc user plugged the said usb drive into their computer, would the user of the app be able to easily download/transfer files directly onto their desktop from the app with a push of a button?
    Secondly, would I be able to display a progress bar showing how much time is left in the download/transfer?
    Lastly, if Air is bad choice for this, does anybody have any other recomendations?
    Thank you all in advance!

    Yes if you build your app with captive runtime you can put it on a thumb drive and copy anything anywhere you want.
    You cannot get the progress of any given file's copyTo(), it does not support that event.  However if you have lots of files, you could simply count them and average.  The progress bar won't be compeltely accurate, but even on the native OS those progress bars are always wrong.  (like windows knows how long that folder copy is really going to take...)  You could also try to do something tricky like use File.download() from a URLRequest built on file://, but I'm not sure it would work.  If you played around with it, you probalby could.
    If you have enough files, just count the files and make the progress bar be a % of the number of files transferred.
    Also remember to copyToAsync() so that it runs in the background and your progress bar is smooth.
    EDIT: please note that a captive runtime will be windows or mac specific (and wont run at all on linux).  As a result if you need to give your thumb drive to people with both OS's you'll have to bulid your application twice.  Also you'll have to have access to both a windows machine and a mac to do that, since you cannot publish for mac on windows and vice-versa.

  • Having trouble downloading Adobe Air

    Hi ,
    I am having trouble downloading Adobe Air .
    Whenever i am trying to download it , the web page is refreshing again and again , without starting my actual download, i waited for considerable time assuming the servers may be busy , but still the download is not starting.
    Downloading from below link
    http://get.adobe.com/air/
    Tried download while logged in using user id 
    [email protected]  , still no luck
    Also tried basic trouble shooting steps mentioned on website such as making sure that my browser is allowing pop ups ,etc
    I am using Mac OsX , 10.6 and browser is Safari , though i tried on the same machine wiht Chrome as well.
    Had a chat with one of the support executive as well , but he was also not able to solve my problem , he directed me to here. Please check why i am not able to download Adobe Air.
    Thanks

    OK I have posted the file here:
    <https://skydrive.live.com/redir.aspx?cid=2dc252adb60ad8c1&resid=2DC252ADB60AD8C1!304>
    The file will remain for 72 hours after which I will delete it.
    Good luck.

  • File Download Open/Save Dialog

    I'm trying to enhance an existing Flex 2 application. The
    application communicates with a web application via HTTPService.
    The Flex application can upload files from the user's local hard
    drive to the web application where they are ultimately stored in a
    database. The Flex application also allows the user to download any
    of these previously uploaded/stored files. The class
    flash.net.FileReference is used to perform the download.
    Everything works fine. The only issue is that when the user
    initiates a file download, he/she is only prompted as to where to
    save the file. We would like to first give the user the option to
    open or save the file... essentially the dialog that
    Internet Explorer gives you when you download a file (.exe, .doc,
    .xls, etc.) directly from a web site. Is there a way to do this?
    Thanks in advance!
    Chris

    Can't access the user's hard drive, even to open a file. You
    need to use Adobe AIR for this.

  • Can you play/view swf files on adobe air for android?

    Hi, yes; I'm new here, as well as to Adobe Air, and I'm still trying to learn the ropes around here, and I apologize in advance if this has already been asked, or I have placed this question in the wrong forum.
    The thing is, I was wondering if it was possible to play my SWF files via adobe air for android; and if so, how? Thanks in advance either way.

    Can you please give directions where can i clear that cash.
    Anyway i don`t think its the case, because this is first time i hooked phone to internet, and first time i launched Android app store.
    Edit:
    I went to https://market.android.com and there is Adobe air app. But when i try to download it says that my device doesn't support it (Samsung Galaxy GT-I5500) By default it comes with android 2.1 and doesn't support Adobe air, but i upgraded firmware to 2.2.
    Maybe that is the reason it doesn't show me Adobe AIR in app store - based on my phone, not my Android version ?

  • Is there a way to download inside AIR HTML?

    Hi,
    Is there any way to download files from the webpage running inside AIR HTML component? i.e. mail attachment etc.?
    Thanks!

    I'm already overriding loaded HTML page's links etc. but yes its true to determine which link is for download or to open just a web page.
    StageWebView!! I was in impression for a long time, this made for mobile! After you saying so, at help.adobe.com I can see this also for all desktop operating systems too! Great!
    Though our existing ol' HTML component is already coded/modified heavily through the application, I don't know how far we can replace them with new StageWebView.. but you simply given me an option. Thanks!
    I'll see a simple demo how enable it is downloading files in an AIR application, shortly.

  • Downloaded matchbook air flash firmware update will not install

    downloaded mackbook air flash firmware update will not install

    Awesome! I was getting really frustrated by this, but found your post and it worked. Thanks!
    I wonder how apple did not come up with a warning when you start the insatllation that would tell you that it would not work with an encrypted disk.  These sorts of warnings should be standard procedure. Whatever, finally the red number disappeared. Thanks lemach again!
    One small addition: After turning file wault off, you need to reboot before starting the update, otherwise the decryption does not take effect.

  • APEX 4.0: error while opening a XLS file downloaded from interactive report

    Hi,
    I'm getting below error while opening a XLS file downloaded from an interactive report (APEX 4.0).
    "The file you trying to open, 'customer_2.xls', is in a different format than specified by the file extension.
    Verify that the is not corrupted and is from a trusted source before opening file. Do you want to open file."
    Yes No Help
    May be this one Apex 4.0 issue.
    please help me.
    Thanks
    Mukesh

    Hi,
    is the next part of the code correct.
    What i mean is packing of the attachment, finding out the size of pdf file and doc type as PDF.
    You can also try below link..
    Link: [http://wiki.sdn.sap.com/wiki/display/Snippets/SENDALVGRIDASPDFATTACHMENTTOSAPINBOXUSINGCLASSES]
    Hope this helps.
    Regards,
    -Sandeep

  • TAx Reporter Temse Files Download Automation

    Hi,
    I have a reuiqrement to download the Temse files generated in Tax Reporter. I have completed the code and it works fine if we run the program in foreground. But when I run the same program in background some Temse files downloaded have junk characters. If I download the same Temse file in foreground it works fine.
    There seems to be some issue with the FM when I run my progam in background.
    I have searched SDN and SAP Notes for any clues but did not get any.
    REPORT  ZPHOP_TEMSE  NO STANDARD PAGE HEADING
                      LINE-SIZE 1023
                      LINE-COUNT 65
                      MESSAGE-ID zz.
    DATA: BEGIN OF tape OCCURS 1,
             DATA(2000),
          END OF tape.
    DATA: force_ascii type c VALUE 'T'.
    DATA:  BEGIN OF int_msgs2 OCCURS 10,
             errnum(2) TYPE c,
             text1(8) TYPE c,
             text2(60) TYPE c,
           END OF int_msgs2.
    DATA: BEGIN OF g_int_temse OCCURS 0,
             dname    LIKE TST01-dname,
             dpart    LIKE TST01-dpart,
             dcretime LIKE TST01-DCRETIME,
             dcreater LIKE TST01-DCREATER,
          END OF g_int_temse.
    DATA: record_length  TYPE i VALUE 275,
           data_length    TYPE i,
           convert_to_ebcdic,
           filesize TYPE i,
           number_of_records TYPE i VALUE 1,
           filetype(3) VALUE 'BIN',
           conv TYPE REF TO cl_abap_conv_out_ce,
           dline TYPE REF TO data,
           dtab TYPE REF TO data,
           p_compid(4),
           p_pswd(8),
           g_str(2000),
           uc_filename TYPE string.
    DATA: l_nm_fixed_record.
    CONSTANTS: c_lpath TYPE pathintern VALUE 'ZOUT'.
    TABLES: TST01, ZPHOPFLS, ZTEMSE_LOG, V_5UXY_A.
    FIELD-SYMBOLS: <dtab> TYPE STANDARD TABLE,
                   <dline> TYPE ANY.
    INCLUDE: dbpnpcom.           " No logical database        Do not modify!
    INCLUDE: zphoptop,           " Top Include                Do not modify!
             zphopfil.           " File inlcude               Do not modify!
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-T01.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) text-001.
    SELECT-OPTIONS  s_temse FOR TST01-dname NO INTERVALS.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-T02.
    SELECT-OPTIONS  s_cai   FOR TST01-DCREATER NO INTERVALS.
    SELECT-OPTIONS  s_date  FOR sy-datum.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE text-T03.
    PARAMETERS: p_ifid   LIKE t9aoa-if_id MODIF ID DIS ,
                p_fileid LIKE t9aoa-file_id MODIF ID DIS,
                p_unixf(60)  LOWER CASE MODIF ID DIS,
                p_uxdir  TYPE pathextern LOWER CASE MODIF ID DIS,
                p_dstfil(45) LOWER CASE MODIF ID DIS.
    SELECTION-SCREEN END OF BLOCK B3.
    PARAMETERS: p_skip AS CHECKBOX.
    DATA: ws_unixr LIKE p_unixf,
          ws_trans LIKE p_unixf.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'DIS'.
          screen-output = '1'.
          screen-input  = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    INITIALIZATION.
      p_ifid = 'PAYFLS'.
      p_compid = 'HR00'.
      p_fileid = '01'.
      p_unixf = 'AFS'.
      p_pswd = 'chevr123'.
      p_skip = 'X'.
    -End of Initialization--
      PERFORM get_physical_path.
      FORMAT COLOR COL_HEADING.
      WRITE: /01 text-t04,
              10 sy-pagno,
              41 text-t05,
             110 text-t06,
             123 sy-datum.
      WRITE: /01 text-t08,
              14 sy-repid,
             110 text-t07,
             125 sy-uzeit.
      FORMAT COLOR OFF.
      SKIP.
      WRITE: /(20) text-T21       CENTERED COLOR COL_HEADING,
              (15) text-T22       CENTERED COLOR COL_HEADING,
              (20) text-T23       CENTERED COLOR COL_HEADING,
              (15) text-T24       CENTERED COLOR COL_HEADING,
              (40) text-T25       CENTERED COLOR COL_HEADING.
    START-OF-SELECTION.
    *Do not allow background processing
    *Check if the Temse file and CAI both are entered
    IF NOT S_TEMSE IS INITIAL AND NOT S_CAI IS INITIAL.
       MESSAGE W999 WITH TEXT-E01.
    ELSEIF S_TEMSE IS INITIAL AND S_CAI IS INITIAL.
       MESSAGE W999 WITH TEXT-E02.
    ENDIF.
    Collect all temse filenames from TST01 into an internal table.
    IF NOT s_temse IS INITIAL.
       SELECT dname dpart dcretime dcreater FROM TST01 INTO TABLE g_int_temse
              WHERE dname in s_temse
              AND   dpart EQ '1'.
    ELSE.
       SELECT * FROM TST01
              WHERE DCREATER in s_cai
              AND   DPART EQ '1'.
         IF TST01-DCRETIME(8) GE s_date-low
             AND TST01-DCRETIME(8) LE s_date-high.
            MOVE-CORRESPONDING TST01 TO g_int_temse.
            APPEND g_int_temse.
         ENDIF.
       ENDSELECT.
    ENDIF.
    SORT g_int_temse BY DNAME DPART DCRETIME.
    LOOP AT g_int_temse.
    Check if the temse file is already processed in ZTEMSE_LOG table.
      SELECT SINGLE * FROM ZTEMSE_LOG
             WHERE DNAME = g_int_temse-dname.
      IF sy-subrc EQ 0.
    error. Temse already processed
         CONTINUE.
      ENDIF.
    Check if the temse file bieng processed is the eligible temse file
      SELECT SINGLE * FROM V_5UXY_A
             WHERE TSOBJ = g_int_temse-dname.
      IF sy-subrc EQ 0.
         SELECT SINGLE * FROM ZPHOPFLS
             WHERE TAXAU = V_5UXY_A-TAXAU
             AND   TXFRM = V_5UXY_A-TXFRM.
         IF sy-subrc EQ 0.
    Generate the filename for the target destination
            CONCATENATE ZPHOPFLS-FILENAME '.' sy-datum '.' sy-uzeit INTO p_dstfil.
         ELSE.
    error. Script not maintained in ZPHOPFLS table
            CONTINUE.
         ENDIF.
      ELSE.
    error. Temse file is not the latest processed file.
         CONTINUE.
      ENDIF.
      CALL FUNCTION 'RP_TS_OPEN'
        EXPORTING
          tsobj = g_int_temse-dname
         versn = g_int_temse-dpart
          empfg = 'RPUTSVUM'.
      COMMIT WORK.
      REFRESH tape.
      CLEAR   tape.
    Einlesen von der TemSe
      CALL FUNCTION 'RSTS_READ'
        EXPORTING
           PARTS1BY1 = 'X'
        TABLES
          datatab = tape.
      CALL FUNCTION 'RSTS_CLOSE'.
    Read the 1st line which is supposed to contains info important for
    the downloading procedure. The syntax of the line is :
      SAPxxxnnnyyyy  - the 1st 3 char 'SAP' indicates this line contains
    download related info. xxx can either be 'ASC' (for ASCII) or 'EBC'
    (for EBCDIC). nnn is the length of each record, e.g. 128 for SSA disk
    format, 275 for SSA tape format etc. yyyy can either be 'CRLF' (each
    record is delimited by CRLF) or blank (no CRLF).
    After processing the 1st line, the line is deleted from the internal
    table. Downloading begins on the 2nd line.
      READ TABLE tape INDEX 1.
      IF tape-data(3) EQ 'SAP'.
        IF tape-data+3(3) EQ 'EBC'.
          convert_to_ebcdic = 'x'.
        ELSEIF tape-data+3(3) EQ 'ASC'
              AND force_ascii EQ 'T'.
          filetype = 'ASC'.
        ENDIF.
        IF tape-data+6(3) NA '*'.
          record_length = tape-data+6(3).
        ELSE.
          record_length = tape-data+13(4).
        ENDIF.
        IF tape-data+9(4) EQ 'CRLF'.
          data_length = record_length + 2.
        ELSE.
          data_length = record_length.
        ENDIF.
        DELETE tape INDEX 1.
      ELSE.
        data_length = record_length.
      ENDIF.
    Transfer the Temse file data to Unix file.
          PERFORM transfer_file.
    Update the Log table with the temse details.
          ZTEMSE_LOG-dname = g_int_temse-dname.
          ZTEMSE_LOG-txcmp = V_5UXY_A-taxau.
          ZTEMSE_LOG-txfrm = V_5UXY_A-txfrm.
          ZTEMSE_LOG-filename = ws_unixr.
          ZTEMSE_LOG-DCREATER = g_int_temse-dcreater.
          INSERT ZTEMSE_LOG.
        WRITE: /(20) ZTEMSE_LOG-dname,
                (15) ZTEMSE_LOG-txcmp,
                (20) ZTEMSE_LOG-txfrm,
                (15) ZTEMSE_LOG-dcreater,
                (40) ZTEMSE_LOG-filename.
    ENDLOOP.
    *&      Form  get_physical_path
          Get Physical directory name for the given logical path name
    FORM get_physical_path .
      CALL FUNCTION 'ZFILE_GET_PATH_NAME'
        EXPORTING
          LOGICAL_PATH               = c_lpath
        IMPORTING
          FILE_NAME_PATH             = p_uxdir
        EXCEPTIONS
          PATH_NOT_FOUND             = 1
          MISSING_PARAMETER          = 2
          OPERATING_SYSTEM_NOT_FOUND = 3
          FILE_SYSTEM_NOT_FOUND      = 4
          OTHERS                     = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " get_physical_path
    *&      Form  TRANSFER_FILE
    FORM transfer_file.
      p_unixf = 'AFS'.
    Concatenate Date with Unix File name
      CONCATENATE p_unixf '.' p_compid '.' p_ifid  '.' sy-datum '.' sy-uzeit INTO ws_unixr.
    Concatenate Unix Directory with Unix File for Outbound
      CONCATENATE p_uxdir ws_unixr INTO p_unixf.
      PERFORM open_files USING p_unixf.
    LOOP AT tape.
         g_str = tape-data(record_length).
        TRANSFER g_str TO p_unixf LENGTH record_length.
        IF sy-subrc <> 0.
          MESSAGE ID '00' TYPE 'E' NUMBER '398' WITH 'sy-subrc:' sy-subrc
           ' Error Transferring to: ' p_unixf.
        ENDIF.
    ENDLOOP.
      PERFORM close_files USING p_unixf.
    ENDFORM.                    " TRANSFER_FILE
    Can anyone please check and tell me what I need to overcome this problem.

    Hi Bhaskar,
    I also have the same requirement to upload TemSe files in to application server.
    In FDTA tcode after we enter company code and click on enter.
    In the second screen checking and line item and go to edit and click on download button.
    Here we see a popup with default file name, and when we say ok the file will get downloaded into C:\.....
    Here our req is to upload the file automatically pick up via batch job and place it in the in to the application server and from there it should be placed in the Netwrok server (UNIX).
    Pls provide me with suitable code so that i can finish it off.I tried a lot but did not work.
    Thanks.

  • To display non US-ASCII filename in file download dialog - Help Needed

    Hi,
    Our application supports to upload a file with name in chinese/japanese language. When user tries to download filedownload dialog box is appearing with the filename as junk characters.
    How to solve this issue to display the filename as uploaded.
    Thanks in advance
    ~kans

    bsampieri, issue is in display of the file name in
    file download dialog.
    ~kansI understood that, but my thought was that the HTTP headers content type containing a charset of UTF-8 might help. I don't know for sure, but otherwise, I don't know how to get the browser to otherwise not assume ASCII.

  • Filename on file download from jsp

     

    This may help:
              ----- Original Message -----
              From: "Erik Lindquist" <[email protected]>
              Newsgroups: weblogic.developer.interest.jsp
              Sent: Wednesday, June 28, 2000 6:20 PM
              Subject: How to dynamically display images in JSPs
              > This took a little while to figure out so I thought I'd share. After
              > doing some research I was led to the following approach on how to load
              > images from an Oracle database into a JSP:
              >
              > The "main" JSP:
              >
              > <HTML>
              > <head>
              > <title>Image Test</title>
              > </head>
              > <body>
              > <center>
              > hello
              > <P>
              > <img border=0 src="getImage.jsp?filename=2cents.GIF">
              > <P>
              > <img border=0 src="getImage.jsp?filename=dollar.gif">
              > <P>
              > world
              > </body>
              > </HTML>
              >
              >
              > And this is the image getter:
              >
              > <% try {
              > response.setContentType("image/gif");
              > String filename = (String) request.getParameter("filename");
              > java.sql.Connection conn =
              > java.sql.DriverManager.getConnection("jdbc:weblogic:pool:orapool"); //
              > connect to db
              > java.sql.Statement stmt = conn.createStatement();
              > String sql = "select image from testimage where filename = '" +
              > filename + "'";
              > java.sql.ResultSet rs = stmt.executeQuery(sql);
              > if (rs.next()) {
              > byte [] image = rs.getBytes(1);
              > java.io.OutputStream os = response.getOutputStream();
              > os.write(image);
              > os.flush();
              > os.close();
              > }
              > conn.close();
              > }
              > catch (Exception x) { System.out.println(x); }
              > %>
              >
              >
              > The thing to note is that there are no <%@ page import="..." %> or <%@
              > page contentType="..." %> tags - just the single scriptlet. It
              > seems that for every "<%@" the weblogic compiler sees it puts
              > out.print("\r\n"); statements in the generated java source.(???) I
              > don't know much about how browsers work but I think that once it sees
              > flat ascii come at it it treats everything that follows as text/plain
              > which is incorrect for the binary stream that's being sent. Another
              > work around was to set out = null; but that's kind of ugly and might
              > produce server errors. The real fix is to write a bean to handle images
              > which I'll work on next (does anybody have any hints on how to do
              > that?)
              Cameron Purdy
              [email protected]
              http://www.tangosol.com
              WebLogic Consulting Available
              "Ramesh" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > Even I could download the files with this technique, I couldn't open the
              file downloaded. It seems the file is getting currepted during tranfer.. Can
              u help me in this regard please?
              >
              > Thank u
              > Ramesh
              >
              > [email protected] (Anders B. Jensen) wrote:
              > >In an Web-application written in Java Server Pages it should be possible
              > >for the user to download data from the web-server. The data will never
              > >exist as a file on the web-server, only in the PrintWriter object, out.
              > >To force the Internet Explorer (IE) to show the download dialog window
              > >the Contenttype of the HTTP-header have been set to "html/transfer". The
              > >question is:
              > >
              > >Is it possible to set the filename appearing in the download dialog
              > >appearing on the client?
              > >
              > >
              > >Below is a listing of the source-code:
              > >
              > ><%@ page extends="com.beasys.portal.admin.PortalJspBase"%>
              > ><jsp:useBean id="download" scope="session" class="dk.lec.DownloadData" />
              > >
              > ><%
              > > String tmpstr;
              > > response.setContentType("html/transfer");
              > > out.clear();
              > > tmpstr=download.getStrbuffer().toString();
              > > out.println(tmpstr.trim());
              > >%>
              > >
              > >
              > >Anders B. Jensen
              > >Consultant, Research & Development
              > >LEC AS
              > >
              > >Remove the SPAMLESS to mail me.
              >
              

  • Can not open file download prompt in portal web app.

    Hi folks,
    I am migrating existing Struts app into portal web app and currently stuck on the following problem.
    In existing app, Struts action calls servlet that generates excel file, sets response headers:
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment;filename=thename.csv");
    that brings up "file download" prompt window.
    In portal app, the same code writes excel file content into browser window instead of the prompt.
    Has anyone had to deal with similar problem? Any help will be greatly appreciated.
    Alex.
    Version of portal used is 8.1 SP5
    Struts - 1.1

    Problem is resolved. For those who might be interested - specifying redirect=true on forward to servlet did the trick.

  • Issue with File Download(messageDownload) on Search Page.

    Hi,
    I created a custom OAF search page which fetches values from one table. The document in getting stored in my custom table in a BLOB colums and NOT in FND_LOBS.
    The table has 3 collumns along with others:
    1st is primary key (Record_Seq) ==> number data type
    2nd to store actual file name (File1Name) ==> varcahar2 data type
    3rd to store the actual uploaded data (File1Data) ==> BLOB data type
    The reason for having the “File1Name” is so that I can display the original file name of the document that was uploaded, instead of just the “view” in the search page results .
    On the File1Data BLOB and created a messageDownload for that under query results table with following details:
    ID : File1Data
    ItemStyle : messageDownload
    FileMIME Type : pdf
    Datatype : BLOB
    View Instance : LacEmpExposureVO1
    view Attribute : File1Name
    File View Attribute : File1Data
    When I click on the "File1Name" data hyperlink, it is opening only the first document corresponding to the first record in the search page results.
    For example, If my search page returns 10 rows then when I click on the file1name on any row, It is open the first row file name only.
    I have a primary key column(RECORD_SEQ) in the Table / EO / VO which is displayed in the search page results.
    Also one weird thing is happening:
    If I try to do this more than 2 times then it is opening the update page with the first record from the search page results…
    I tried to print the context and it is nul the first time, But the second time then context is changing to "update". Dont know how this is happening????
    Any advice is greatly appreciated as it is very crucial for me to get this resolved ASAP. I have looked at several forums and did a lot of things as advised in the forums . But nothing seems to work for me.
    Thanks,
    Mir
    CO code for the search page
    ===========================
    if (pageContext.getParameter("Create")!= null)
    System.out.println("Into LacEmpExposureCO in PROCESS FORM REQUEST with Context of CREATE");
    pageContext.setForwardURL
    ("OA.jsp?page=/lac/oracle/apps/lac/lacempexposure/webui/LacEmpExposureCreatePG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, //Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);
    else if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
    System.out.println("Into LacEmpExposureCO in PROCESS FORM REQUEST with Context of UPDATE");
    System.out.println("LacEmpExposureCO ==> RecordSeq in PROCESS FORM REQUEST is: " + RecordSeq);
    HashMap params = new HashMap(1);
    params.put("RecordSeq", RecordSeq);
    pageContext.setForwardURL
    ("OA.jsp?page=/lac/oracle/apps/lac/lacempexposure/webui/LacEmpExposureUpdatePG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    params,
    true, //Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    else {           
    String strEvent = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);
    System.out.println(strEvent);
    System.out.println("Into the last ELSE part in LacEmpExposureCO.java");

    Duplicate post -- Issue with File Download(messageDownload) on Search Page.

  • I am having problems downloading files from the web. After a number of files are downloaded, the system become sluggish, and then hangs. I traced the problem to the download history file: downloads.sqlite.

    After downloading a number of 1.0 MB files, the system became very sluggish, and I started to get lots of (Not Responding) messages when trying to download or just use Firefox for browsing. Using Performance Monitor, I observed that the Firefox executable was growing larger and larger - up to as large as 1.2 GB on a system with 2.0 GB memory. Page faults were off the chart.
    Looking for a similar problem, I found one that discussed the downloads.sqlite file becoming corrupted. I first noticed that this file was over 600 MB in size, so I deleted it. I then downloaded additional files, and observed that the new downloads.sqlite file would increase in size by about 150% of the size of each file that was downloaded. Once it would get up to 500 MB in size, the system started slowing down again.
    I don't know the purpose of this file, but it appears that it keeps a full copy of every file downloaded, which may be the function of a download history file, but it does not seem correct that the file should grow in size without limit, and thus impact the system.
    I would also appear that the Firefox executable is trying to read the entire contents of this file each time a new file is downloaded, which does not seem right.
    Temporary fix is to periodically delete the downloads.sqlite file when it gets too large and starts impacting performance.. Apparently it is smart enough to open a new file if the old one is not found. I am not sure what the correct behavior for this file should be. Apparently is does not re-initialize when a new Firefox session is initiated.
    Please feel free to contact me if more information is desired. I'm not sure what details you might need to troubleshoot this type of problem.

    Hi Katy, and a warm welcome to the forums!
    What is the exact name of the file?
    Is it aim.bin?
    Which requires either Stuffit Expander, or the Unarchiver to deflate.
    http://www.apple.com/downloads/macosx/systemdiskutilities/theunarchiver.html

  • File downloads not working in Pepper-Flash beta 11.8.800.115 (chrome)

    Pepper-Flash Beta version 11.8.800.115 was auto-installed in latest Chrome update (29.0.1547.57 m).  This flash version does not display save/open dialog when clicking on a link that opens a file via flash.net.navigateToURL(request, "_self").  Request is an http get that calls a servlet that responds with a binary stream.

    The follow are two separate workarounds that we used.  We initially used the first workaround below until figuring out #2.
    (1) Use the download function on a flash.net.FileReference object.  The flow is not as nice, but works as long as the download occurs as part of a user initiated event, such as a button click.  We added a switch so that this workaround was only used if the browser was Chrome, so that IE and Firefox kept the same flow.
    (2) Embed a hidden frame in your html and make an ExternalInterface call similar to the following to target the download to it.  We also have an exit page prompt, but targeting a hidden frame does not affect it:
    ExternalInterface.call("downloadFileToHiddenFrame", url);
    Javascript function...
    function downloadFileToHiddenFrame(locationRef) {
        top.frames["myhiddenframename"].location.href = locationRef;
    One note, we always use application/octet-stream as the mime type for downloads to avoid the possibility of the file actually rendering in the hidden frame.  After implementing #2 above, file downloads in Chrome now flow exactly the same as before the pepper flash issue surfaced.
    Hope this helps.

Maybe you are looking for