DownloadServlet or alternative method for file download

I have searched the forums for this topic and have seen one other posting from someone having the same problem (with no response). I can not get the oracle.jsp.webutil.fileaccess.DownloadServlet to fully function. Using the file access example code that is installed with iAS and following the instructions in the manual "Oracle Application Server Containers for J2EE JSP Tag Libraries and Utilities Reference 10g (9.0.4)" I can get the file upload to work just fine (both to a file and to the database). However with the file download it stops short of working. It will access the DownloadServlet and list the files that have been uploaded, but when you try to follow the link that it creates you get a "400 Bad Request"
If you look at the URL it creates I see what I think is a problem
Here is a clip of code from dbBeanDownloadExample.jsp that creates the URL
The following files were found:
<% Enumeration fileNames = dbean.getFileNames();
while (fileNames.hasMoreElements()) {
String name = (String)fileNames.nextElement();
%>
<br><a href="<%= servletPath + name +
    ?"+FileAccessUtil.SRCTYPE_PARAM + "=" + dbean.getSourceType() +
"&"+FileAccessUtil.TABLE_PARAM + "=" + dbean.getTable() +
"&"+FileAccessUtil.PREFIX_COL_PARAM + "=" + dbean.getPrefixColumn() +
"&"+FileAccessUtil.DATA_COL_PARAM + "=" + dbean.getDataColumn() +
"&"+FileAccessUtil.FNAME_COL_PARAM + "=" + dbean.getFileNameColumn() +
"&"+FileAccessUtil.FILETYPE_PARAM + "=" + dbean.getFileType() %> ">
<%= name %></a>
<% } %>
and here is one of the URLs
http://iasserver.here.com:7779/ojspdemos/servlet/download/beanexample\fields.txt?srcType=database&fileType=binary&table=fileaccess&prefixCol=fileprefix&fileNameCol=filename&dataCol=data
The problem I see is the fileprefix (from the upload) "beanexample" and the filename "fields.txt" is appended to the end of the servlet "download", while the rest of the parameters to the DownloadServlet are passed in the proper manner "srcType=database". I have been unable to find any documentation on the DownloadServlet so I don't know if there are setters for the fileprefix or the filename.
This example code has been out for sometime, I know it was with iAS 9.0.2. Has any one been successful implementing the download of a file from the database using the oracle.jsp.webutil.fileaccess.HttpDownloadBean or the tag?
Certainly Oracle must test this stuff before they release it. At some point I think this must have work.

Larry, the DownloadServlet certainly worked at some point of time as ensured by the automated tests. It should work all the time, I believe, unless......
The problem I see is the fileprefix (from the upload)
"beanexample" and the filename "fields.txt" is appended to > the end of the servlet "download", while the rest of the
parameters to the DownloadServlet are passed in the proper > manner "srcType=database". I have been unable to find any
documentation on the DownloadServlet so I don't know if
there are setters for the fileprefix or the filename.A nice observation. That is the root cause of the problem, I believe. Actually, the documentation is right there in the example dbBeanDownloadExample.jsp. You should use
  String name = (String)fileNames.nextElement()).replace('\\','/');
as in the example instead of
  String name = (String)fileNames.nextElement();
Well, I will check if this point of changing '\' to '/' have been made explicitly in the documentation. That kind s of tiny point is sometimes really a killer.
Hope this helps.

Similar Messages

  • Adding a new layout for DME for file download

    Hi All,
    How do i add a new layout for file download in DME?
    Thanks
    William Wilstroth

    This problem is solved.
    Need to enhanced the T042O table.

  • Java WebDynpro's and IE security settings for file download

    We have a EP 7.0 SP13 environment on which we have deployed a number of own developed java webdynpro's. In some of these webdynpro's we provide the file download functionality. The portal and webdynpro's are used by both internal personnel and external customers.
    On the other hand the default Internet security settings for Internet Explorer, disable "Automatic prompting for file downloads".
    When a user, with these default security settings active, tries to use our webdynpro's file download functionality, the screen seems to refreshes but no file download starts. When (s)he retries, the session runs for some minutes and gives following error message:
    "com.sap.tc.webdynpro.services.session.LockException: Thread SAPEngine_Application_Thread[impl:3]_20 failed to acquire exclusive lock on client session ClientSession".
    This behavior is explained in SAPNote 1234847. Webdynpro provides a single-thread module, meaning a user session is blocked for the during of the request. And because the previous file download isn't yet completed the new try can't start.
    Issue now, although the users IE settings allow file downloads and don't block pop up's, he can't download the file and even isn't made aware of the cause of the failure.
    How can we avoid this issue, without having to communicate the
    application requires specific browser settings?

    Welcome to the Apple Support Communities
    See > http://support.apple.com/kb/HT5290
    You can install the program using different ways:
    1. Right-click the application installer and choose Open.
    2. Go to System Preferences > Security and Privacy and select Anywhere in Allow applications downloaded from

  • Drop-down Menu to Open URL for File Download

    I am using Adobe Captivate 5.5 and was wondering if it is possible to create a drop-down menu that can be used to open different URLs for file downloads, kind of like the Attachments button Presenter has. Captivate seems to have a dropdown widget available but I can't tell if this would work for this purpose.

    Hi Theo
    You can use any composition to create a menu with setting for show target on rollover and then link targets to specific pages.
    Adobe Muse CC 7.0 Tutorial | Beautiful Graphic Navigation - YouTube
    Thanks,
    Sanjit

  • JSF error message: Automatic prompting for file download

    This is a weird problem. I have a JSF application wherin I popup a new window on a submit button.
    The window opens a test.jsf page that redirects the output to a servlet1.
    Servlet then based on some parameters does a sendRedirectI() to different servlets out of context.
    Now the issue is that when the output is redirected to out of context servlet, that returns a file download.
    If in IE browser, if one does not do a setting of "Automatic prompting for file download", this window that I had opened on submit buttton vanishes in a jiffy. If the IE setting is done, it shows the file download correctly.
    I would want to show the user some kind of message by which he/she understands that this IE setting has to be done.
    I have tried several ways:
    1. Javascript: window.onbeforeunload on the test.jsf so that when the window unloads i can show some message. But since test.jsf forwards to servlet1, the html page generated does not show my script.
    2. I also tried checking if some windows registry can help me understand the setting.
    3. I tried writing in response object the javascript and then redirecting it to servlet out of context. But I guess sendRedirect() does a new request, so this did not help.
    Can anyone help? I am not sure if I am able to explain my problem correctly.
    Yani

    Here is the result.I used your code and it worked fine with IE setting Enabled. But when I tried to access the download servlet after opening a new window, it doesnt download the file.

  • Problems with signed Applet for File Download under JRE 1.4 (works with 1.3

    Dear all,
    i encountered a very strange behaviour with JRE 1.4x. A signed applet used for file download worked on all platforms (Windows NT, 2000 and XP wth/wthout SP...) until I installed JRE 1.4.x (1.4.1 or 1.4.2)
    I get an EOFException when downloading binary files (for ASCII it works fine) when trying to readByte() from a DataInputStream. But not immideately, but after x bytes in the while-loop. Security is fine (I know there have been changes to that in jre 1.4, the applet itself can be started an runs with ASCII files for transfer)
    Does anyone know, what has changed in jre1.4.
    As I said, it works fine under jre 1.3.x
    The relevant code is below: byte bt = dis.readByte(); causes the error
    try{
    // Get URL from Server
    URL uFile = new URL(sFilename);
    sThisURLFile = uFile.getFile();
    Integer inte = new Integer(i);
    //open input stream for the file on server
    DataInputStream dis = new DataInputStream(new BufferedInputStream
    (uFile.openConnection().getInputStream()));
    //open output stream for the file on local drive
    String sFilenameOnly = sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1);
    int iDotPos = sFilenameOnly.lastIndexOf(".");
    String sExt;
    if (iDotPos > 0) {
    sExt= sFilenameOnly.substring(iDotPos);
    } else {
    sExt = "";
    File fileOut = new File(sDownloadDir + sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1) );
    DataOutputStream dos = new DataOutputStream(new
    BufferedOutputStream(new FileOutputStream(fileOut)));
    //read one byte from input stream, and write that byte to output stream
    long nByte = 0;
    int iCnt = 0;
    iFilesizeDone ++;
    while (nByte < iFilesize){
    String sErrPs = new String();
    try{
    sErrPs = "00";
    byte bt = dis.readByte();
    sErrPs = "01";
    dos.writeByte(bt);
    } catch (EOFException ee)
    System.err.println("internal EOFException: " + ee.getMessage());
    System.out.println("Error Filesize is " nByte " of " iFilesize "---" + sErrPs);
    break;
    nByte++;
    iFilesizeDone ++;
    iCnt ++;
    if(iCnt >= 10240) {
    ShowProgress(nByte, iFilesize, iFilesizeDone, iFilesizeTotal); // repaint does not work during init-procedure
    iCnt = 0;
    line = "Progress: Total: " + ((iFilesizeDone*100)/iFilesizeTotal) + " perc, " + iFilesizeTotal/1024 +" kbytes" ;
    labLine.setText(line);
    //dos.flush(); // improves Client performance (Agent-Call!)
    dis.close();
    dos.close();
    }// End try
    catch (EOFException ee)
    System.err.println("EOFException: " + ee.getMessage()e);
    catch (SecurityException se)
    System.err.println("SecurityException: " + se.getMessage());
    catch (IOException ioe)
    System.err.println("IOException: " + ioe.getMessage());

    perhaps they've changed something with the file blocking.
    btw, you should try to use something like this
    DataInputStream dis = new DataInputStream(is);
    byte[] buffer=new byte[8192];
    int numBytesRead;
    while ( dis.available()>0 ) {
         numBytesRead = dis.read(buffer);
    }               

  • Peformance Turning for File Download / Upload with Enabled SharePoint Audit

    Greetings all, may I ask your help for Peformance Issues?
    Background:
    I tried to create a ASP.NET Web Page to download/upload/list SharePoint file and deployed to IIS website in same application server (will NOT use web part as some users are NOT allowed to direct access confidential workspace)
    Besides, for Audit Log record purpose, the page will impersonate (without password) the logged in user:
    SPUserToken userToken = web.AllUsers[user].UserToken;
    SPSite s = new SPSite(siteStr, userToken);
    For File Listing, the web service can provide fast response, and we are using service A/C for connection (as no auting for listing, but require audit for file download upload)
    Several implemeation options tested for File Downloiad / Upload, but issues occured and finding listed below:
    Issues
    1) SharePoint Object Model
    When I open Site (using new SPSite), it's too slow to respond. (under 1s for all operations, but require 10~50s for open SPSIte. e.g.
    using(SPSite s = new SPSite(siteStr) //50s
    How can I download/upload file without open SPSite object (using SharePoint object model, but user token should be kept to allow SHarePoint identifiy user actions. e.g. Updated by Tom, NOT system administrator)?
    2) SharePoint default web service
    For file download, I tried to use SharePoint Web Service for download file, it's quick but how can SharePoint record the audit log to downloaded user, and not service A/C? ( e.g. View by Tom, NOT system administrator)
    With Windows SSO solution, please note system should NOT prompt to ask user password for use impersonation
    3) HTTP Request API (for file download)
    As mentioned in point 2, if the system cannot get password from user, SharePoint also recorded service A/C in audit log... ><
    Thank you for your kine attention.
    .NET Beginner 3.5

    Thank you for prompt response, please find my reply with Underline:
    Hi,
    Maybe I'm not quite clear about the architecture you have now.
    Is your asp.net application deployed in separate IIS site but in the same physical server as SharePoint?
    Yes
    "we are using service A/C for connection", can you please explain the 'A/C'?
    Domain User, Local Admin and also SharePoint Service Admin A/C
    Opening SPSite is relatively slower but shouldn't take 50 sec. However it depends on your server hardware configuration. You should meet the minimum hardware requirements for SharePoint.
    Assigned double resources based on minimum hardware requirements.
    For details, 50s is the load test result. But for other SharePoint operation, it takes around/under 3s reponse time.
    Are you using SharePoint Audit log? Exactly If so then why don't you just put the hyperlink to the documents in your asp.net page. User maybe have to login once in SharePoint site but
    it depends on your security architecture. For example if both of your sites in local intranet and you are using windows integrated authentication, SSO will work automatically  User is NOT allowed
    to access SharePoint site/server (not implemented for sepreate server yet, as performance issues occured for
    separate site in same server)  directly from Internet, the
    middle server with web interface created for user request.
    Whatever I understands gives me the feeling that you download the file using HTTPWebRequest C# class. However regarding security it depends on how authentication is setup in asp.net web site and in sharepoint. If both site uses windows integrated security
    and they are in the same server, you can use the following code snippet:
    using (WebClient webClient = new WebClient())
    webClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
    webClient.DownloadFile("file ur in sharepoint", "download directory");
    Thanks, will try and reply later
    But still, as I've mentioned, not quite clear about the whole architecture.
    A) Request Handling
    1) User use browser to request file listing and/or download file (hereafter called: File Download Request) from custom ASP.NET page (Let's say In Server 1, IIS 1)
    2) ASP.NET page  or File Handler ashx (Server 1, IIS 1) call custom web service, SharePoint deault/OOTB web service or using SharePoint Object Model to access SharePoint Document Library (in Server 1,
    IIS 2)
    3) Both SharePoint and IIS Web Site
    (Server 1, IIS 1 & IIS2) using the same service A/C
    4) The web service , File Handler return file obeject to IIS1
    5) IIS 1 reply File Download Request to user
    B) Application Architecture (In testing environment)
    1) no load balancing
    2) 1 DB server (Server 2)
    3) 1 Application Server (with IIS 1 - ASP.NET, IIS 2, SharePoint Web Site with default SharePoint Web Service, IIS 3 SharePoint Admin Site & IIS 4 Custom SharePoint Web Service)
    4) Sepreate AD Server (Server 3)
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com
    .NET Beginner 3.5

  • Any way to set up iWeb pages for file download / sharing?

    I have been using .Mac Homepage to set up several web pages to share audio files with my clients. I have been able to set up a different web page for each client, each with their own password, with files there for them to download.
    Is there a way to duplicate this using iWeb now that .mac homepage sites are going away? I don't want the audio to stream, I just want to make the files available for downloading, and don't see any page templates in iWeb '08 for file downloading.
    I know that I can use mobileme's new file sharing feature to email links to individual files, but this doesn't work as well as having all the files downloadable on one or more web pages.

    If you have all of the sites in one domain file you should be able to upload only the changed pages but it's been a while since I used 08 so don't remember. You can move each site into its own domain file so that only that site is edited and published. And if you're publishing directly to mobile me only the edited files should be uploaded.
    I use iWebSites to manage over 75 individual sites.. It lets me create multiple sites and multiple domain files.
    If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites. Be sure to make a backup copy of your original Domain.sites files before starting the splitting process and move it to another location on your HD until you're satisfied the separation process is completed and what you want.
    This lets me edit several sites and only republish the one I want. Make sure you're running the lastest version of iWeb, 2.0.4 I believe.
    An example of files set up for immediate download is Toad's Cellar. Each linked is linked to a zipped file which downloads when clicked on. The site could be password protected if so desired.
    OT

  • Automatic prompting for file download

    I am using a File Download Servlet. Theres a setting in IE under Securiy Settings --> Downloads--->Automatic Prompting for File Downloads.If I have this disabled, I am able to download the file.If its enabled, I am unable to download the file successfully. Anyone have faced this problem before?

    Here is the result.I used your code and it worked fine with IE setting Enabled. But when I tried to access the download servlet after opening a new window, it doesnt download the file.

  • Alternative method for loadObjectLibrary()

    Hi,
    Iam new commer to this openscript.Urgent.. Please any one help me which one is the alternative method for loadObjectLibrary() in openscript9.2.

    Termination
    Set Up Personnel Actions
    Create reasons for Personnel Actions
    Define Action Type for Termination
    Define Infogroups
    Determine Periods of Notice
    Before making the settings in feature 40TRM, you must set the same Action Type for the Action
    Reasons N0, N1 and N2 in the table view Reason for Action (V_T530).
    you can use IMG link under Payroll India -> Termination -> Create reasons for Personnel Actions.
    For example- if 40TRM return value is 10 then there shud be action reasons N0, N1, N2 for the Action 10 in V_T530.
    well 1 more thing, enter the pernr in termination workbench and press ENTER then try to check F4 of 'Reason'.
    I know it looks funny but as the pernr is mandatory field there, you need to press 'Enter' after this.
    Determine Deadline Type
    Maintain Calculation Factor for Retiral Benefits
    Calculation method for Notice Pay
    Try this hope u have maintained the Gratutiy configuration correctly

  • Is there any alternative method for GET_FRONTEND_FIELDCATALOG in CL_GUI_ALV

    Hi all,
    Please let me know if there is any alternative method for GET_FRONTEND_FIELDCATALOG (CL_GUI_ALV_GRID class) in the class CL_SALV* family. I need to capture the field catalog(Or list of fields) of the current output list.
    I have saved many layouts on my ALV output with different combinations of fields, When I select one layout and click on the custom button it should process only the fields displayed on ALV.Please let me know how do I get the fields displayed on ALV using CL_SALV_* family classes.
    Thanks,
    Prathap

    Hi,
    Check this link...[Setting up Layout|http://help-abap.blogspot.com/2008/09/salv-model-4-setting-up-layout.html]

  • How to do popup for file download???

    Hi,
    I'm trying to create a popup for file selection for download. Basically, I want to call:
        call method cl_gui_frontend_services=>file_open_dialog
    This works fine from a report, but from my web dynpro I get a dump because apparently there is no gui (parameters www_active and activeX are all empty).
    Does anybody have any experience with this? I'm thinking:
    - am I doing something wrong?
    - does this method work with web dynpro at all?
    - is there some other CL_WD* class for this purpose?
    - are my system settings screwed up?
    Thanks for all hints!
    Ira

    This might be helpful:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/42af9f90-0201-0010-6099-ba67e5426bdf
    - April King

  • Implementing file "Save as" functionality for file download api

    Hi,
    I want to implement File Download (Open/Save as/Cancel dialogue box) programmatically.
    I am displaying list of links to document in a web dynpro table and I dont want to set IWDResource data for all entries in table.
    And on Click of a button/link to action, I want to open up a File download box.
    I have URL to the file with me and I'm able to convert it to IWDResource.
    Following are the things available with me for a selected file:-
    -- Complete name of file along with extension
    -- byte[] of file.
    Please help.
    Thanks and regards,
    Amey Mogare

    I could achieve it with following code:-
         String l_str_LinkValue = null;
         String l_str_LinkName = null;
         URL l_url = null;
         InputStream  l_is_inputS = null;
         try {
              l_str_LinkValue = wdContext.currentCtx_vn_KmFolderDataElement().getLinkValue();
              l_str_LinkName = wdContext.currentCtx_vn_KmFolderDataElement().getLinkName();
              l_url = new URL(l_str_LinkValue);
              l_is_inputS = l_url.openStream(); 
              IWDResource res = WDResourceFactory.createResource(l_is_inputS, l_str_LinkName, WDWebResourceType.UNKNOWN, true);
              if(res != null){
                   wdContext.currentContextElement().setFileRes(res);
              }else{
                   myMessage.reportException("Unable to create file", true);
         catch (MalformedURLException mfurle) {
              myMessage.reportException("MalformedURLException : "+mfurle.toString(), true);
              wdContext.currentContextElement().setFileRes(null);
         catch (IOException ioe) {
              myMessage.reportException("IOException : "+ioe.toString(), true);
              wdContext.currentContextElement().setFileRes(null);
         catch (Exception e) {
              myMessage.reportException("Exception : "+e.toString(), true);
              wdContext.currentContextElement().setFileRes(null);

  • Help with HttpClient for file download

    I am writing a class to download files from a website.
    The site gave me a user name and password for login
    I need to write codes to login automatically using the userName and password the site gave me.
    Please I need some help on how to do this.
    Thanks
    Cypray

    The following in google returns a number of links that look like it discusses this. I know as well that the user/pwd issue has been discussed on this site before.
    java http "file download"

  • Test for file download complete

    Does anyone know an accurate way to test that a file download is complete? Reports are being brought down from a server and I want to know if the download is complete before I begin parsing the file.
    Anyone know how to do this? Is File.canWrite() an accurate test?
    Thanks,
    Matt

    Our server team initiates the download.Then you're out of luck. You can monitor the file size change over time, but it might as well be an incomplete or aborted download. I wouldn't know if a file that's written to will be blocked for reading. Might be, might not be. I'd say not, given my experience.

Maybe you are looking for

  • Net value is calculated

    Hi guys, Pls clarify my doubt,In my pricing procedur I have not maintained any value in subtotal column against the condition type kept all the columns blank even then how system calculating the Net price and the tax  in billing Regards Bhuvanashree

  • Soft proofing in LR 4

    I purchsed and downloaded LR 4 online. In the Develop Modue when I want to soft-proof. I press 'S' to get the soft proof menu but do not have the soft-proof box under the image that I see in  ALL the examples when going through tutorials. I tried clo

  • How to adjust volume iPhone 4 for conversations?

    How do I adjust volume on iPhone for conversations?

  • HT204053 Access to iCloud.

    How do I access the iCloud. Is there an icon on my homepage.

  • Rights & authorizations on the Visual admin tool SP13

    if some one can tell me if rights and authorizations can be managed around the Visual administrator tool in order to manage accesses and users use and this tool. Thanks in advance, Eric.