Web.show_document and File Save As

Hello,
I have a Perl CGI scrfipt on the server that I can call from a web brwoser. Its purpose is do save a file passed in to any locatgion on the PC.
In the borowser I can use:
http://devpong/cgi-bin/cap/savefile.cgi?dirpath=/capexp/to_SGP&fname=ZU060920.C78
and I get a Save As dialog and it is written to that directory. Works very well.
This is the Perl CGI code:
use CGI ':standard';
use CGI::Carp qw(fatalsToBrowser);
my @fileholder;
my ($web_keys)= ["dirpath", "fname", "mode"];
my ($Param) = get_params($Param, $web_keys);
# print_head($Param);
# redirectwindow($Param);
open(DLFILE, "$Param->{dirpath}/$Param->{fname}") || Error('open', 'file');
@fileholder = <DLFILE>;
close (DLFILE) || Error ('close', 'file');
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$Param->{fname}\n\n";
print @fileholder;
I want to do the same thing from the Forms 6i application. In web.show_document I put in the exact same URL that works stand alone in the browser and have tried all of the seceond argument setting (_BLANK, etc.). Just for a millisecond a window opens then immidately closes. I have included a raise FORM_TRIGGER_FAILURE in the trigger to make it wait, but to no avail.
I found a document that said if a URL works in the browser, it will work in web.show_document. That is not true for me.
Do I need to build an html page first to open in the borwser from web.show_document?
Does webutil_file have the ability to let the user choose the destination directory?
What we did in the past was to make sure the file extension was not in the registry of the PC. Then the browser would force a Save As dialog. With XP SP2 this does not work without making several changes to the file types.
That is why I would like a solution that does not rely on file type set up.
Any suggestions will be appreciated.

Well, it sounds like you want the server to tell the client that this content shouldn't be read from cache...
Among the posible solutions:
Apache can be configurated with modules like 'mod_expires' and 'mod_headers'.
Or, you could write a JSP file that sets the appropriate http headers and streams your file accordingly. The http headers I think you're interested in:
- cache-control (to prevent client caching)
- content-disposition (to set the filename of the download)
You might want to read this thread:
http://p2p.wrox.com/topic.asp?TOPIC_ID=29405
Cheers,
Mel.

Similar Messages

  • Closing the browser windows created by web.show_document and javascript

    From Forms I am issuing a http request using web.show_document and javascript:window.open(). The http request makes a remote procedure call to a coldfusion component on a JRun appserver. I want this rpc to fire in the background so that the current forms browser window remains as is.
    The logic is as follows
    l_rpcURL := 'http://....just a standard URL.....'; -- edited for this thread
    l_jsURL := 'javascript:window.open("' || l_rpcURL || '","","fullscreen=no,titlebar=no,location=no,toolbar=no,menubar=no,status=no,resizable=no");self.close();';
    WEB.SHOW_DOCUMENT (l_jsURL,'_blank');
    The http request works fine but leaves a browser window behind. It's the one created by the javascript.window.open(). If I remove the self.close() from the javascript then I have two browser windows open, one from web.show_document and the other, as described previously, from the window.open().
    Any idea how I can force closure of the window opened by the window.open() ?
    Thanks

    Hi,
    did this occured afer installing service pack 2?
    A work around is The only solution that is to create a close.html file and calling this file in the code: Web.show_document('http://server:port/close.html','_self');
    <html>
    <body onload="closeit()">
    <script>
    window.close();
    </script>
    </body>
    </html>
    Monica

  • Problem when using WEB.SHOW_DOCUMENT and passing in lexical parameter

    Hi,
    I got a blank page with error "An error has occured while trying to use this document" when I tried to use web.show_document and passing a lexical parameter to 10g report on 10gAS. The URL in the web.show_document is:
    http://<srvname>:<portnum>/reports/rwservlet?server=repserver90&report=myrpt.rdf&destype=Cache&desformat=pdf&userid=<usr>/<pw>@<db>&where_clause=where%20product_type%20in%20('REPORT')
    If I change the desformat to htmlcss, it is fine to display the report. But doesn't work with desformat=pdf. The pdf file has been generated in the cache. Why can't it display on the screen.
    Also I tried to use double quote the value for where_clause. The pdf report showed up. But it ignored the where clause.
    Experts please help.
    Ying

    I use lexical parameters and they work fine, but I use a parameter list. The code is contained in a form that is called by all forms that wish to run a report. This way you only need the logic for printing in a single form. If you want the form, email me at [email protected]

  • Ctrl+S and file save just get ignored and I have to close the file to save docs

    I am using DW CS5.5.
    Ctrl+S and file>save just get ignored and I have to close the file to save docs.
    Any ideas? Thanks

    "If this configuration folder is the one in the Program Files hierarchy, you may have shot yourself in the foot.  Never mess with those."
    I had a neighbor one time who was annoyed that "that darn bolt on the bottom of my engine" kept scraping on the curb when he'd pull in or out of his driveway, so he ground it down till it was flat with the oil pan. It wasn't till about a year later when he took the car in to have the oil changed that he realized the error of his ways. Cost him $500 to have the pan pulled and replaced.
    If you don't know what it does, find out first or leave it alone.

  • Web.Show_document and oracle session

    Hi,
    I am uploading a file on to Oracle Portal through web util. After this, I am calling the web.showdocument to view the uploaded file. But I am seeing only a blank page. This is the sequence flow.
    1. Forms call a procedure which will create a dummy record of the document to be uploaded. This insert is happening as an autonomous transaction.
    2. The Forms call webutil and uploads the document
    3. Then I am calling web.show_document to view the document. The browser is opening an empty page. But once I did an explicit commit, I can open and view the document successfully in the same way.
    I am using '_blank' option.
    So, what I infer from this is that web.show_document opens the browser with a new oracle session by passing authentication details internally. Is there any way view the document without doing an explicit commit?
    Thank you.
    Warm Regards,
    Raja.
    Message was edited by:
    Raja M

    Check
    [b]Mozilla Firefox Options
    File Types
    The Download Actions dialog, which can be opened by clicking the
    Manage... button, contains file types that you have downloaded.
    You can choose what Firefox should do when clicking on a specific
    file type by selecting the file type you want to modify and clicking the
    Change Action... button.

  • Troubles with web.show_document and internet explorer

    Hi folks, this is my problem
    I generate a text file on forms and then I use this to open the document in a new window
    web.show_document( nome_ver_, '_BLANK' );where nome_ver_ is a variable with the url
    Using mozila firefox this run fines and a new window is open and everything goes right.
    But in some machines with the internet explorer the new window appear and then close in milliseconds. I try different's versions of IE on the machine and still have the problem...
    Anyone see this bug?
    I try to disabled everything on secure on IE and still nothing...
    Sorry for my bad english and thanks in advance
    Luis

    You are generating a text file you say. Is it a pure text file? Or is it html that you wnt the user to view in the browser?
    In what versions of IE is this happening in?

  • Web.show_document and Firefox

    Hi,
    we are usin web.show_document in oracle forms 9 for showing
    scanned documents
    Call working fine in IE all versions, but in firefox ver.2.0.0.6 we are not able to see *.tif document. When we press the button nothing happens. Is there problem with firefox settings or in the call web.show_document function.
    Thank you very much for any answer.

    Check
    [b]Mozilla Firefox Options
    File Types
    The Download Actions dialog, which can be opened by clicking the
    Manage... button, contains file types that you have downloaded.
    You can choose what Firefox should do when clicking on a specific
    file type by selecting the file type you want to modify and clicking the
    Change Action... button.

  • Calling a report with web.show_document and put pdf in temp directory

    Hi,
    I need to call a report 10g with web.show_document in order to generate a .pfd file (not viewed by the user) as soon as the user press a button in a form.
    I have two problems. Firstly, after generate .pdf, it's opened a undesirable windows "process succefully" (I don't want that window). Secondly, in url parameter, I put:
    (...)DESTYPE=File&DESFORMAT=pdf&DESNAME=' || client_win_api.get_temp_directory
    the target directory to .pdf file might be the user temporary directory, and not c:\temp, because in Windows XP the user haven't some writing privileges.
    How there is spaces in temporary directory, like:
    C:\Documents and Settings\<user>\Local Configurations\Temp
    I supose that Get_temp_directory returns something that:
    C:\Documen~1\<user>\Local~1\Temp
    And web.show_document don't understand.
    Can anyone help me?
    Thanks a lot,
    medina.

    Hi Maahjoor,
    i have install windows xp on vmware having loop back adapter configure with ip 192.168.10.1.i am using oracle developer 10g suite and oracle 10g r2 database.
    i want to call a report using the following code on a button.i have attached the report to the form.
    i have started the report server by issuing rwserver server=repsrv.
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status varchar2(20);
    BEGIN
    repid := FIND_REPORT_OBJECT('ALL_EXPENSES');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := RUN_REPORT_OBJECT(v_rep);
    WHILE rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    WEB.SHOW_DOCUMENT('http://192.168.10.1:8889/reports/rwservlet'||substr(v_rep,'_',-1)+1||'?'||'server=repsrv','_blank');
    ELSE
    Message('Error when running report');
    END IF;
    end;now when i run the command, i get this error
    frm-41214: unable to run the report
    frm-41219: cannot find the report.invalid id.
    argument 1 to builtin run_report_object acnnot be null.
    i thin the problem is with this line. WEB.SHOW_DOCUMENT('http://192.168.10.1:8889/reports/rwservlet'||substr(v_rep,'_',-1)+1||'?'||'server=repsrv','_blank');
    can anyone help? or a better piece of code?>
    I think you are mixing up the web.show_document usage for URL and with RUN_REPORT_OBJECT.
    I hope you have studied this document http://www.oracle.com/technetwork/products/migration/frm10gsrw10g-132606.pdf . It has the required examples and code.
    Cheers,

  • Problems with "File Open" and "File Save As" in Tiger

    I recently upgraded to OS10.4.3 on my PowerBook G4 and ever since I have had only frustration upon frustration with this new version.
    When launching a program whether it be QuarkXpress 6.5, Illustrator CS, Photoshop CS, InDesign CS or Acrobat 6.0 and you go "File Open", it can take up to 3 minutes before the "Open" window dialog box will appear so that you can access your files. The same applies to the first "File Save As" in any of these programs. After that everything works normally.
    Has anyone experienced this problem with Tiger and is there a solution? I should be most grateful for any assistance.
    Leon
    PowerBook G4   Mac OS X (10.4.3)  

    I got so frustrated with iDisk that I did indeed turn mine off altogether. Now I just mount it when I need it, and do whatever I want to do manually. And it is STILL annoyingly slow, not only in its own operations, but in the way it hijacks the Finder and can sometimes bring all Finder operations to a grinding halt.
    I keep a local copy of the all the files I have on my iDisk in a perfectly normal folder. And I keep looking forward to the day when the promised seamless operation of my local files and iDisk will actually work.
    I've been waiting for several years and thru several different incarnations of the OS, and it ain't there yet. I think Apple's version of WebDAV is just really really bad. I've heard other WebDAV servers work better. And I figured it was a bad sign when, back in Panther, one of Apple's own helpers recommended a third party WebDAV software (Goliath) to access the servers rather than using the Finder. I didn't think things could get any worse--until Tiger came along. A bad situation can get worse, and it did.
    Maybe when Leopard gets here.....
    Francine
    Schwieder

  • Web browsing and file downloads stops

    Hi Guys,
    I've been looking at a few posts but not seen the answer yet.  I'd be grateful if someone could help me out or point me in the right direction.
    I had BT Infinity 2 installed with the HH5 on Friday.  I have problems with browsing web pages.  When I click a link most of the time the page loads quickly without issue, but then occassionally the page wont load and the page will 'stick'.  It sometimes take 30-60 seconds for the page to fully load, or there is a timeout.  Usually, by reloading the page it resolves this and the page loads really quickly again but within a minute you will have the same issue.
    Also, I have downloaded a few files, from 300mb to 1gb.  Just like web browsing, the file download will stop and the only way to resume the download is to reboot the HH5.  I had to reboot the HH5 five times to download the full 1gb file.  I checked the connection and it's not dropping so I wonder why the connection just stops or sticks for a while.
    I know it can take a while for the connection to settle down but it shouldn't stop working.
    Am hoping someone could help me out with this as i need this for my business.
    With thanks,

    I would leave it alone for the next few days and do not keep restarting the Homehub. This will cause DLM (Dynamic Line Management) to kick in and lower your speeds because it will interpret the restarts as a fault. It is normal for the speeds to fluctuate during the training period. If things do not improve after the ten day training period post back for more advice.

  • Web.Show_Document and Shared Directories

    Hello,
    I want to use web.show_document to access a shared folder on a machine.
    Whenever I issues the web.show_document to \\workstation\folder\ the browser appends \\workstation\folder\ to the end of the application server URL (eg: http://appserver/servlet///workstation/folder/). Is there any way around this problem?
    Thanks,
    Jayesh Kavia

    web.show_document('file://c:\word\martin.doc','_SELF');
    //Martin

  • Web Pages and file download corruption Cisco VPN

    We have a problem our users are having. Clients are having problems using Cisco 5.06 VPN along with Internet Explorer. Quite often web pages hang or load incorrectly or unformatted. Also links to documents or downloads are downloaded unusable (i.e. a PDF file that is corrupt). If you refresh the page or retry the download it will work eventually. None of these problems exist while they are directly on the corporate network. (Win7 32-bit OS)
    Our standard corporate VPN installation package uses Cisco VPN 5.0.06.0160 which installs version 3.22.4.17992 of DNE (Deterministic Network Enhancer), It also installs the DNE Update version 4.9.1.1837. This combination works correctly in our standard corporate build. The problem exists in two of non-standard builds on a couple different hardware models.
    If I uninstall the DNE update and the VPN client and just install the VPN client by itself without the DNE Update (which leaves the client at 3.22.4.17992 for DNE) the problem goes away and the web pages load correctly and the files download properly.
    I have tried the latest DNE, and updates to the NIC driver without success. Any suggestions or logic to why the newer versions of DNE will not work. The hardware we are using are high end HP and Dell Mobile workstations that are only about a year old. We have a problem our users are having. Clients are having problems using Cisco 5.06 VPN along with Internet Explorer. Quite often web pages hang or load incorrectly or unformatted. Also links to documents or downloads are downloaded unusable (i.e. a PDF file that is corrupt). If you refresh the page or retry the download it will work eventually. None of these problems exist while they are directly on the corporate network. (Win7 32-bit OS)
    Our standard corporate VPN installation package uses Cisco VPN 5.0.06.0160 which installs version 3.22.4.17992 of DNE (Deterministic Network Enhancer), It also installs the DNE Update version 4.9.1.1837. This combination works correctly in our standard corporate build. The problem exists in two of non-standard builds on a couple different hardware models.
    If I uninstall the DNE update and the VPN client and just install the VPN client by itself without the DNE Update (which leaves the client at 3.22.4.17992 for DNE) the problem goes away and the web pages load correctly and the files download properly.
    I have tried the latest DNE, and updates to the NIC driver without success. Any suggestions or logic to why the newer versions of DNE will not work. The hardware we are using are high end HP and Dell Mobile workstations that are only about a year old.

    I would leave it alone for the next few days and do not keep restarting the Homehub. This will cause DLM (Dynamic Line Management) to kick in and lower your speeds because it will interpret the restarts as a fault. It is normal for the speeds to fluctuate during the training period. If things do not improve after the ten day training period post back for more advice.

  • Whenever I right click on an image on a web page and select 'Save image as...', the filename always ends with '.jpg.jpeg' instead of '.jpg'. How do I stop Firefox doing this? It doesn't happen when I try the same thing with Internet Explorer

    It hasn't done this since I first installed Firefox, only the last month or so.
    I've tried running in Firefox safe mode with all extensions disabled but this makes no difference.
    I've also found the following article:
    http://kb.mozillazine.org/File_types_and_download_actions
    ...that suggests reseting the '''browser.download.pluginOverrideTypes''' & '''plugin.disable_full_page_plugin_for_types''' entries in about:config but I don't have these entries so can't reset them

    In that case you may need to look in the Windows registry with the registry editor (regedit.exe) to see if the problem is there.<br />
    You can do a search (Ctrl+F) for <b>jpg</b> after navigating to the HKCR\MIME\Database key.
    HKEY_CLASSES_ROOT\MIME\Database\Content Type

  • Problem with web.show_document with Jinitiator and Firefox

    Not sure Firefox 2.0 is officially certified with Forms 9.0.4.1 and Jinitiatorbut regardless we have some users who want to use this combination. Everything seems to work fine except for the calls to web.show_document which opens a new browser window and displays some html etc.
    The problem is that even though the client Forms JVM is Jinitiator (1.3.1.18 or .21) when the call to web.show_document occurs somehow the Sun Java Plugin starts and having the two JVM's at once causes a fatal crash in Firefox. Can anyone suggest a way to preven the second JVM from opening?
    When the user uses the Sun Plug as the client Forms JVM there is no problem as the second JVM does not open. Unfortunately some users insist on Jinitiator with Firefox hence the problem. -quinn

    James,
    This whole applet embedded in a browser model for webforms is driving us batty at times. The list of problems includes:
    1) Users are constantly tempted by browser controls and accidentally do all sorts of things to get them in trouble. This has included but not limited to using the navigation arrows, jumping off to read their email in the same window as the form and returning to a dead forms session, minimizing, resizing, blurring off to another window and then returning back by clicking on the title bar of the browser and wondering why the form doesn't tab etc.
    Sure hobbling the browser by opening with limited functionality is a possibility but not a complete solution.
    2) New versions of browsers seem to break something. Both IE 7 and Firefox 2 have their own problems with web.show_document, especially file associations such as CSV and DBF and trying to open things in Excel in IE7.Firefox seems to have less problems for some yet some some oddities like the one that started this thread (and 2.0 opening new windows in tabs by default instead of windows).
    3) JVM jigsaw puzzle. Is it Jinit or Sun, which versions? Which combinations of browser version and JVM works.
    4) General fragility of the whole architecture. Running a client JVM in a web browser on top of a PC Operating system connectiong to a forms server over a network embedded in a Java Container server on a full blown web server running on a unix operating system is pushing the bubble. Throw in the mix that any of these components can be combined in numerous ways makes one wonder how it works as well as it does.
    Still users randomly getting dropped connections to forms server (network gltches?). General sluggishness (poorly written forms?). Periods of users with unduplicatable errors primarily network related it would appear.
    General feel that it is not rock solid stable. Perusing metalink documents on performance and tuning gives too much and too general info to troubleshoot so just shrug shoulders and say 'network problem'.
    What's the solution? Java webstart would seem to help at least with the browser realted issues but is that supported and documented how to use yet. Also we'd lose web_show_document which is critical (could it be replaced by webutil calls to open browser?).
    -quinn

  • Report Path in Web.show_document()

    I have called report using the web.show_documents() and it works perfect when I used absolute path of the report like "F:\Apps\Reports\test.jsp". But I like to use relative path like my working directory in formsweb.cfg is "F:\App" I like to use the path "Reports\test.jsp" but this syntax does not work, cannot find the path specified. How can I do that... Looking forward to a help from the forum memebrs.
    Thanks
    Hasan Al Mamun

    Hi!
    In your developer_home/reports/conf directory exists a file called REP_YOURPCNAME.CONF.
    Please make a backup copy of the file.
    Open the file (not the backup) with a text editor of your coice.
    search for the line
    <!--property name="sourceDir" value="your reports source directory"/-->  and change it to
      <property name="sourceDir" value="F:\Apps\Reports"/>  save the file and restart your oc4j instance.
    Regards

Maybe you are looking for

  • Is there a non-idiot interface to BT Cloud?

    In the process of ugrading to Infinity 2 so thought I'd take a look at BT Cloud since the 50Gb available could be useful to me. However, I can only find a frankly patronising application which wants to sort everything into 'photos', 'music', 'videos'

  • Running an application developed in Oracle Forms and reports

    Hi Folks, Does anyone know or have an opinion on whether an application developed in Oracle Forms/Reports can run on Oracle Cloud as it is a supported product? It is also possible to 'mix' adf and forms , but on the cloud.....? Thanks Alex

  • Backup Problem via db13

    Dear Team, I am using HP-UX with Oracle. When I am doing Full Online backup via db13 . It give error BR0428W File /oracle/PRD/sapreorg/sr3700.data11.Z will be overwritten BR0202I Saving /oracle/PRD/sapreorg/sr3.data1.Z BR0203I to /dev/rmt/0mn ... BR0

  • User login records on Hyperion Financial Reporting

    Hi all, We understand we can turn on audit to capture the user login (authentication) in Hyperion Planning. Can we have the same option/feature for Financial Reporting to turn on audit so that we know that which reports in one day was generated by en

  • Sun's AMAgent

    When I run my portal on a window's server, authenticating through sun's access manager, i have no problems. But when I convert to a linux box, none of my jsp's are getting called / displayed. If i take the amagentfilter out, content still displays in