2004s file download (how to not store files in context?)

Hi,
I want to use FileDownload element in my web dynpro application.
I use the new type resource  and my own input source implementation, which generates files on the fly.
Each download call should result in a new file. These files can be very large (some MB).
For obvious reasons I don't want the server to store the byte data in application context (200 users * 2 MB ....)
How can I do this?
If I use resource as context element and set debug points on my input stream, I can see the data is read just on time if the user wants to download.
I create my data in my inputstream and the download starts. So far so good.
On the second click on the download link the download starts without any read operation. Thats the problem.
Possible reasons:
First: the data is read and stored to the context on the first download. this would be bad! context would get very very large. not working for me.
second: the browser or the server caches the data. how can I avoid this?
thx in advance
btw I read a tutorial about up and downloading. this pointed to an additional article called something like "downloading in web dynpro tables". But I can't find it. There the on demand downloading should be explained. any help would be great.

Hallo Thomas,
ok, the "default" on-demand streaming solution caches a Web Resource but does not re-calculate it again afterwards.
I wrote a Wiki Code Tutorial which demonstrates how to download an Excel File from a Web Dynpro table UI element on-demand. In this scenario the resource must also be re-created on every request. The solution is based on re-initializing the context with a new  0-byte resource objects within the calculated context attribute getter method.
See <a href="https://wiki.sdn.sap.com/wiki/display/Snippets/ExportingTableDatainWebDynproJava-SAPNetWeaver04s">Exporting Table Data in Web Dynpro Java - SAP NetWeaver 04s</a>
For you the most important line of code in
//@@begin javadoc:getExcelResourceOnDemStreamCalc(IPrivateExcelExportComp.IExcelElement)
   *  Declared getter method for attribute ResourceOnDemStreamCalc of node ExcelResource
   *  @param element the element requested for the value
   *  @return the calculated value for attribute ResourceOnDemStreamCalc
  //@@end
  public com.sap.tc.webdynpro.progmodel.api.IWDInputStream getExcelResourceOnDemStreamCalc(IPrivateExcelExportComp.IExcelElement element)
    //@@begin getExcelResourceOnDemStreamCalc(IPrivateExcelExportComp.IExcelElement)
    IWDInputStream excelOnDemandStream = null;
    try {
      excelOnDemandStream =
        WDResourceFactory.createInputStream(toExcel(tableDataNode, tableColumnInfos).getBytes("UTF-8"));
    } catch (UnsupportedEncodingException e) {
      wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), true);
    // Reset context attribute 'Excel.Resource' again by creating a new 0-byte resource object.
    // Otherwise the on-demand Excel stream gets calculated only once as the resource object,
    // cached in the Web Dynpro Binary Cache on server-side, keeps the same.
    initializeOnDemandExcelResource();
    // Return excel on-demand input stream
    return excelOnDemandStream;
    //@@end
is the method <b>call initializedOnDemandExcelResource()</b> re-initializing the context attribute with a new 0-byte resource object.
//@@begin others
  //======= Private Methods ===========================
   * Create new on-demand resource instance for excel file. This method must be
   * invoked initially and in the calculated context attribute getter method (calculating)
   * the excel resource input stream. Otherwise the resource is streamed to the client only
   * once but not afterwards so that later updates of the table data are not reflected in the
   * streamed Excel file.
   * URL is stored in context so context in client component can map to it.
  private void initializeOnDemandExcelResource() {
    excel0ByteResource =
      WDResourceFactory.createResource(calcAttrPointer, "Table.xls", WDWebResourceType.XLS);
    excelResourceElement.setResource(excel0ByteResource);
    excelResourceElement.setResourceURL(
      excel0ByteResource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()));
Regards, Bertram

Similar Messages

  • HT4847 How can I store files on iCloud?

    How can I store files on iCloud?

    Actually, I have found that this is very possible, combining several other tips from around the web, though perhaps not easy.  I am using Moutain Lion.  I am assuming that you have already activated and signed into iCloud previously.  Here are the steps for creating a cloud storage location that you can drage any file into, and access from any of your Macs:
    1) Create a new folder in the directory that is synced with iCloud.  Start by opening a Finder window, and going to the ~/Library/ directory.  Do this by typing Shift-Command-G while the Finder is open, and typing ~/Library in the goto window.  Next, open the directory "Mobile Documents".  Finally, Control-Click inside the Finder and select the "New Folder" option, naming it whatever you like -- I chose "iCloud".
    2) Step two is about creating a shortcut to this iCloud folder in the Finder.  You cannot directly drag the iCloud folder into the Favorites section of the Finder, but you can do this:  Control-Click on your new folder, and select "Make Alias".  Now, drag this alias over to your Favories panel in the finder.  You will be prompted whether you really want to move the Alias out of iCloud: Say "Yes".  Now, delete the Alias -- you don't need the original instance of it any more. (Alternatively, you can skip to the end of step 3 and drag the symbolic link into the Finder Favorites)
    3) Step three is about being able to access this iCloud folder from the Unix command line, and from the Desktop GUI.  Open a Terminal window (Launchpad => Other => Terminal).  By the way, I recommend putting the Terminal into your Taskbar, if it isn't already.  You should be in your home directory ... to verify, type "cd" and press Enter.  Now, create a Unix symbolic link (an Alias won't work for this) to the actual location of the iCloud folder:
    Type "ln -s ~/Library/Mobile\ Documents/iCloud/ iCloud" and press enter.  The command should be entered precisely, I recommend cut and paste.  The first character is a lower case "L" and there is a space after the backslash between "Mobile" and "Documents".  You should now have a symbolic link to the iCloud folder created.  To view it in the Finder, go to your home directory: Shift-Command-G, and then enter "~/" into the window.  You should see a folder called "iCloud" there, with a little arrow animation in the corner.  You can drag this into the Taskbar to have a permanent clickable shortcut.  You can also access the contents of this folder through the terminal.  From your home directory, just type "cd iCloud" and press Enter.  You are now in the iCloud folder (or more properly, your local version of it), and can use the usual Unix tricks ... "ls" to list contents, "mkdir ABCD" to make a new directory called "ABCD", "mv a.txt b.txt" to rename a file "a.txt" into "b.txt", etc.
    4) Step four is about accessing this folder on other machines.  On a second Mac, repeat all of the steps above *EXCEPT* for creating the New Folder in step 1 ... it already exists, but you can get it into your finder bar, and create sym-links in the same way from there.
    The great thing about this is that when you work, you are editing a *local* copy of the file, so you can work offline if you like.  Then, whenever you have internet access, the *actual remote* cloud copy of any new or modified files is uploaded.  Likewise, updated files are downloaded from the cloud to get your local files into sync.  You have the benefit/safety of a local hard copy, AND the portability (and extra safety) of cloud storage.  It's exactly what I wanted, and it works like a dream.  Plus, time machine can back up your *local* copies, to maintain version history.  I'm not quite sure what happens if you try to simultaneously edit a file from two places, but don't do that.
    Hope that helps you!
    JWSpaceman

  • How can i store files from a PC on time capsule

    How can i store files from a PC on Time Capsule

    Actually although the format on the TC is not NTFS but Mac HFS+, that is irrelevant as far as windows is concerned. The TC offers SMB protocol to the network.. so how the TC stores the files is totally irrelevant.
    1. TC is by nature not particularly SMB happy..
    Change all names, TC and wireless to SMB compatible. Short, no spaces, pure alphanumeric.
    Turn on the guest account to read write access.. assuming you don't have security issues.
    Set the workgroup correctly.. don't use wins server.. no body does nowadays.
    Note short no space names.. guest access and workgroup all set.
    2. Download and install airport utility for windows or just bonjour for windows.. bonjour should be included with the full uitlity but that is not necessary.
    3. Just doing the above when bonjour loads it should bring up TC as accessible.. if not, or you need to access it manually.. open windows explorer and type in the address bar.
    \\TCName or \\TCIPaddress .. obviously replacing the generic name with the actual one used. In my case. as per the above screen shot. \\TCGen3
    You will then see the main root directory of the TC.. data or whatever it is named..
    Create a new directory under the root directory for your windows files.. and copy them there.
    Note .. some issues can arise if you are using the TC for TM backups.. Please keep a large enough amount of free space available that TM still works.. pondini recommends using disk images.
    http://pondini.org/TM/TCQ3.html
    As long as you still have plenty of free space this is not an issue but TM may have issues when it fills the drive as it is designed to do.

  • File Download In Button not link

    Hi
        I want to download a file from my application for that i have used the file download UI element but that file download looks like a link but i want it to look like a button not link for that i tried to change its type property but it don't give me looks like button so please help me out in downloading the file by clicking a button (not link)
    Thanks in advance

    Hi Ninad,
    Insert button, for action handler put something like:
         final byte[] content = //get content of the file;
         final IWDCachedWebResource resource = WDWebResource.getWebResource(content, WDWebResourceType.<APPROPRIATE_MIME_TYPE>);
         try {
              final IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(
         resource.getAbsoluteURL(), "Window title", false);
              window.open();
         } catch(Exception e) {
              wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
    Best reagrds, Maksim Rashchynski.

  • Took backup of data files and controlfile but not archive file db is 11g xe

    took backup of data files and controlfile but not redo file db is 11g xe r2..was trying complete shut backup,..missed redo..
    anyway to restore the db back..
    I had failed to backup redo log file..
    db was shut...properly
    any info highly appreciated.
    cheers
    Edited by: zycoz100 on Feb 27, 2013 4:42 AM

    A controlfile create is a fairly trivial task, for either a cold backup or hot backup scenario. Well, its an easy task after you've done the process a few times.
    If you have a healthy oracle instance running any place else, preferably at 11gR2, or even a 10g instance can work as an example, get a system connection and do an `alter database backup controlfile to trace;` and the instance will create a new trace file with all SQL commands needed to rebuild the controlfile in the instance trace directory.
    Have a look at the trace file, a `show parameter diag` reveals the diagnostic_dest parameter, look for the "trace" directory under that folder, for the latest *trc file. In 10g its `show parameter dump` and the trace file goes straight to the user_dump_dest directory, no digging required.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I have a Macbook Pro Apple . My photos are in iPhoto files. How do transfer the file I want to work on onto Photoshop?

    I have a Macbook Pro Apple . My photos are in iPhoto files. How do transfer the file I want to work on onto Photoshop?

    Where iPhoto Pictures are Located and How to Access the iPhoto Library and Picture Files

  • How should I store files (nef, dng, other)?

    As a new user of CS5, I would like to know how most experts save images.  Right now, I load nef (Nikon raw)  images from the camera to my Windows PC using "get photos from camera" in Bridge.  I then edit some images using Camera Raw and (sometimes) using Photoshop with layers. I also add metadata of my own.   I would like to have one file for each image if possible.  I just do not like to have  a lot of different versions hanging around.  I am not concerned about backup because I backup the entire PC daily.  I do want to preserve all potentially useful data from the camera though.  When needed, I use Save to create jpegs for external use, e.g. for Shutterfly or (using different settings) for Web use.  I usually save these separate from the original nef files and their companion files.  When a file has been edited only by Camera Raw, I notice that it remains a nef file.  When it is edited by Photoshop, it gains a companion psd file, and when metadata is added it gains a companion xmp file.  I keep these nef files and their companion psd and xmp files toegether in the same folder sorted such that the three are adjacent.  Is this the best way to store these images? 
    Incidentally, the Photoshop Essentials course from Lynda.com and the Adobe Help documentation do not cover the above companion files adequately in my view.  Can you comment on this point?
    Jim Mullen
    Tahoe City, CA

    Since you asked how others do it, I'll describe what I do:
    I save all my original files by Year \ Month \ Occasion on my computer on a 2 TB RAID 0 - based hard drive partition.  These include raw images, JPEG images, and scans (saved as .PSD files).  All are online (about half a terabyte of data total) so I can easily access what I need when I need it.
    I back these files up to two different external USB MyBook drives in two different parts of my house, as well as to DVD (more recently blu-ray DVD for the added storage).  I do incremental backups that ever-accumulate, so I'm protected from accidental erasure, as well as full system image backups that can be used to completely restore each of my entire systems.
    I never overwrite my original files, and I even go so far as avoiding using Camera Raw to open JPEGs because it will write metadata back into JPEG files.  And I never write any editing products back into my original photo folders.  This helps avoid accidents.  Photoshop CS5 now actually has a setting one can configure that will instruct it to remember a different default for Saves as for Opens.  I like that.
    Usually, for most uses, I just reprocess my original file if I want a print, or to use a copy online, etc.
    For complex Photoshop projects, I save PSD files in separate folders from my original photo files, named for the project.
    Regarding making backups, I suggest this mantra:  "Don't invite disaster, but there's nothing wrong with preparing for it."
    Hope this helps!
    -Noel

  • Windows Downloaded setup.exe, not iso file.

    Well... I just recently bought windows 8, but it downloaded a file called windows8setup.exe -- not an iso. I don't have a windows machine to open the exe, so how can i get the windows iso?

    So i guess my question is: How can i get the windows8 iso from the setup.exe without having access to a windows computer.

  • How do I store files on iCloud?

    How do I store documents and files on icloud?

    Through the apps themselves, what files were you thinking of.
    By the way, if your profile is correct, you don't have iCloud. iCloud comes with OSX 10.7.2 or later.

  • How to not create File without any payload?

    Hi XI Experts,
    I have the following integration scenario:
    1.  One input file
    2.  One or more output files (up to four files)
    3.  At any given time, I could have one or more files (up to four files) filled with data in the payload.
    Question - there are times where only one file will have data in the payload and three files without any data in the payload (by design).  In this case, I do NOT want to create files that does not have any data in the payload.  Is there any way I can do this without BPM?  The output files that does not have any data in the payload is not going to be 0 byte as it will still have blank XML tags.
    Again, we do not want to use BPM if there is any way around it.  We are running XI 2004s SP7 (equivalent to 2004 SP16).  Any help would be greatly appreciate it.
    Here is the content of the ouput file WITHOUT any data in the payload:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:entity-data xmlns:ns0="urn:dow-com:xi:data:vendavo:10">
    </ns0:entity-data>
    Here is the content of the ouput file WITH data in the payload:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:entity-data xmlns:ns0="urn:dow-com:xi:data:vendavo:10">
        <com.Dow.customer.DCorporate>
            <VName>DCorporate</VName>
            <VLabel>013-ZZ</VLabel>
        </com.Dow.customer.DCorporate>
    </ns0:entity-data>
    Thanks,
    Jay

    Hi Jay..,
    You can achieve this without BPM too.Your input is one file,by doing the Multi Mapping (1: N) you can acheive this.If there is no payload for any of the four files means simply put your four message types occurences as 0..Unbounded.
    Check / Put an condition on your input file payload which field is determining whether data is containg for all or for some of the files.
    So, if your input file containg the data for four files, those files are would be populated otherwise the files are not getting populated.I guess there is no use to create the blank XML structure.
    Let me know your feedback.., It would be work for your case ..
    Cheers
    Tiger woods

  • Files downloaded in firefox not visible

    Any file i download gets automatically converted to "Binary file" type .
    Also files which i download will be shown in the "show all downloaded files page" but cannot be opened directly. And the files downloaded in the specified path will not be visible

    Thanks Ideato..
    I tried resetting the download options by deleting "mimeTypes" and restarting firefox browser, but still the problem exists...
    i tried downloading google chrome.. snapshot attached here for your reference... the file would be in "binary" type... not able to know what's the reason...
    the same problem exits with any other downloadable files, and best part after download the file disappears :)
    the problem is not with the procedure of downloading but the file getting converted to binary type..
    please let me your suggestions on this... Thanks everyone

  • When any mp3 file downloading on Firefox so this file not download yet this file online play

    hello sir,
    my name is tushsr powar and I like Firefox browser but here is same problem when I any mp3 file download so this file not download this file auto play but I want this file download so please help me about this matter

    In Firefox 21 you can long press on the playback to download the file. Firefox 21 can be downloaded from http://aurora.mozilla.org and it will show up as Aurora on the all apps listing.

  • WRT54GS v1 Corrupting large file downloads - how to fix?

    I have a two week old WRT54GS v1 (firmware 1.0.02) that appears to be corrupting file downloads of more than 2 or 3 Gb, more specifically program installation downloads.
    When downloading, the files appear to arrive properly according to their file sizes.  However, in both instances I've experienced this week with installation packages from different sources, the installation would fail with either Error 2350 or Error 11FD.  (file corruption errors)
    If I take the router out of the loop by connecting the desktop directly to the cable modem, the packages come through without error.
    It has been suggested that this has something to do with a broken transmission or filter issue caused by the NAT hardware firewall (I don't have a clue what that means)
    Does anyone have any suggestions?
    Rick Grant

    You should try to upgrade your router's firmware, reset and re-configure it...
    Download Firmware 1.7 MB...
    Follow these steps to upgrade the firmware on the device : -
    Open an Internet Explorer browser page on a computer hard wired to the router...
    In the address bar type - 192.168.1.1...Leave the username blank & in password use admin in lower case...
    Click on the 'Administration' tab- Then click on the 'Firmware Upgrade' sub tab- Here click on 'Browse' and browse the .bin firmware file and click on "Upgrade"...
    Wait for few seconds until it shows that "Upgrade is successful"  After the firmware upgrade, click on "Reboot" and you will be returned back to the same page OR it will say "Page cannot be displayed".
    Now reset your router :
    Press and hold the reset button for 30 seconds...Release the reset button...Unplug the power cable from your router, wait for 30 seconds and re-connect the power cable...Now re-configure your router...
    After re-configuring the router, observe the connection and see if it corrects your problem...

  • File download box does not appear when trying to download adobe

    As I was unable to open any pdf documents i uninstalled & tried to reinstall adobe however nothing happens, the file download box doesn't open at all. I'm using windows 7 home premium. Anyone got any suggestions, could there be something causing this in my computer?

    Use the offline installer from http://get.adobe.com/reader/enterprise/

  • File Adapter - how to get the file count from a folder

    Hi All,
    I have a requirement that have to poll a directory when the file count is reached to number N (ex:number of files avilable in folder is 5) otherwise it should wait and not pick any of the files. Is it possible to get the file count from a folder using file adapter ?? otherwise please suggest me an approach to achieve this requirement.
    Thanks,
    JJ

    Hi Sarath,
    Thank you for your reply.
    Go with the list files operation of file adapter it will gives you the number of files in the specified folder as you given. . - this step is already done.
    When the number of files reaches your count startup your webservice that which can polls the files. . . - how can i acheive this?? Have to poll the directory and process the number files - please let me know, what could be added to the webservice which is being invoked after cheking file count from parent process.
    The reason for the above question is - we cannot use ReadFile operation in second webservice because it will be automatically triggered when the file is avilable. Also SyncRead operation supports reading one file in b/w bpel process. Kindly explain me the implementation steps.
    Thanks,
    JJ

Maybe you are looking for

  • Text sounds with new software update

    i can't get the sound to shut off for outgoing texts now since i updated the software this morning. anyone have this issue??

  • Screen Preview Error

    Ok, I'm getting a problem when I hit the spacebar in Bridge CS6. Instead of viewing the image full screen, I get the attached screenshot. The same thing happens when I enter review mode. I'm using Mac OS X 10.7.4 with CS6. thank you

  • Windows 8.1 Bitlocker fails.

    Hello,  Im trying to enable BitLocker on my windows 8.1 laptop.   It starts the setup, shrinks my partition but then gives me the following error.  BitLocker Setup failed to copy boot files.  You may need to manually prepare your drive for BitLocker.

  • Reg:- Custom Error Message for 404 error in KM Document iView

    Hi All, We have a requirement to display a custom error page instead of the standard"404 - The requested resource is not available" displayed in KM document iView, when the resource in question doesn't exist. Is it possible to display custom error me

  • Tables as part of function module

    I am trying to develop a function module and want i_mcha as part of the tables section. But i_mcha should be part of a custom type that I can create. Is it possible to create a type in the global data of the function module and use that type for the