Set default directory/path for SaveAs Dialog using WPG_DOCLOAD

Hi, im trying to set the default directory/path for the SaveAs Dialog called by wpg_docload.download_file.
I'm not able to find where I can specify the default path.
Is it something like "htp.p('Content-Disposition: attachment; path=:PX_OUTPUT_DIR" ?
Thx for your help !
Here's a part of my code
owa_util.mime_header( NVL(mime,'application/octet'), FALSE );
htp.p('Content-length: ' || length);
htp.p('Content-Disposition: attachment; filename="'||substr(fileName,INSTR(fileName,'/')+1)|| '"');
owa_util.http_header_close;
wpg_docload.download_file( lobLoc );
/*********************/

I don't believe you're allowed to set the directory path in the Content-Disposition (or any other) header. More accurately, you can set path in the filename, but browsers don't pay any attention to that, they only look at only the terminal filename.
<p>According to RFC 2183, browsers are supposed to ignore any path information sent with the filename. Even though it's dated 1997, I believe this RFC is still in effect.
<p>This was done as a security precaution against malicious web apps that might try to download into a system directory or other dangerous place. Also, browsers (usually) allow users to specify their own default download directories. Further, even if you could specify the path, you'd have to do it for any and all filesystems (Linux, Mac HFS, Mac OSX, Windows, etc etc).

Similar Messages

  • How to set default file path for save

    Hello all,
    I'm currently blocked on the below issue and is hoping to gain your help and insights.
    We have recently upgraded to InDesign CS6. Now when an INDD file created in an older version of INDD is opened in CS6, all the save dialogs would not default to the location of the original INDD file. Though if the same file is opened in the version of InDesign that created it, the save dialog goes to the proper location by default.
    Debugged using our custom plugin as a gate way, and found out that after InDesign CS6 performed the document upgrade/convert, the database for the converted document loses file information. i.e.  IDataBase::GetSysFile() returns nil. I think we can figure out some way to get the original file path. For example, we can intercept "kAfterOpenDocSignalResponderService", and get the original file path of the opened file from IDocumentSignalData. Though I haven't yet able to figure out a safe way to set this file path to the document, so that the save dialogs would by default point at this path.
    Utils<Facade::IWorkgroupFacade>()->InitDocumentAssetManagement(docRef, filePath) seems to do the right thing, but it seems to be quite intruding, and I'm afraid that it is overkilling and will cause bad side effect for the use case I'm looking for.
    So I'm wondering if anyone has any suggestions to achieve this without implementing/overriding the file save dialog.
    Thanks.
    -Jeff

    You should be able to avoid writing your own open-doc trap by using kDocBoss's IOpenedFileInfo to obtain the original file's path. It seems fairly reliable; the only time I've seen it come up empty is for an opened QuarkXPress document.
    I'm afraid I don't know of a sanctioned way to change IDataBase::GetSysFile() without going through the database's SaveAs machinery. Overriding this behavior might only be possible by replacing the regular Save dialog with your own.
    But if InitDocumentAssetManagement() is helping, maybe the workgroup/asset management approach is worth pursuing. Have you tried spying on that call in the debug app? You might be able to isolate and use one of the commands that it's invoking (IAMSPManager::BindAsset() / kSetAssetAttributesCmdBoss?) without all of the side-effects of the higher-level call.

  • How to set default file type for Open dialog

    Dear my friends,
    I am using "At selection-screen ON VALUE-REQUEST FOR filepath" to display open dialog and i want to set default file type for open dialog = *.txt.
    Thank your times !

    Hello,
    U can make use of this code:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SP_FILE.
      PERFORM SAVE_DIALOG CHANGING SP_FILE G_F_RC.
    FORM SAVE_DIALOG CHANGING PO_FILE PO_RC.
      DATA: L_VA_BOXTITLE     TYPE STRING,
            L_VA_DEFAULTFILE  TYPE STRING,
            L_VA_DEFAULTNAME  TYPE STRING,
            L_VA_DEFAULTPATH  TYPE STRING,
            L_VA_DEFAULTFULL  TYPE STRING,
            L_VA_FILTERTEXT   TYPE STRING,
            L_VA_CODE         TYPE I.
      CLEAR: PO_RC, G_F_CONF.
      L_VA_BOXTITLE   = TEXT-B01.
      L_VA_FILTERTEXT = TEXT-B02.
      IF PO_FILE IS INITIAL.
        CLEAR L_VA_DEFAULTFILE.
      ELSE.
        L_VA_DEFAULTFILE = PO_FILE.
      ENDIF.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          WINDOW_TITLE            = L_VA_BOXTITLE
          DEFAULT_EXTENSION       = 'TXT'
          DEFAULT_FILE_NAME       = L_VA_DEFAULTFILE
          FILE_FILTER             = L_VA_FILTERTEXT
          INITIAL_DIRECTORY       = 'C:SAPWorkdir'
        CHANGING
          FILENAME                = L_VA_DEFAULTNAME
          PATH                    = L_VA_DEFAULTPATH
          FULLPATH                = L_VA_DEFAULTFULL
          USER_ACTION             = L_VA_CODE
        EXCEPTIONS
          CNTL_ERROR              = 1
          ERROR_NO_GUI            = 2
          OTHERS                  = 3.
      IF SY-SUBRC <> 0.
        PERFORM CHECK_ERRORTYPE(Z48M_MATDATA_UP) CHANGING SY-MSGTY.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        CLEAR PO_FILE.
        EXIT.
      ENDIF.
      IF L_VA_CODE NE 0.
        MESSAGE S818(3F) WITH TEXT-011.
        CLEAR: PO_FILE, PO_RC.
        EXIT.
      ELSE.
        WRITE L_VA_DEFAULTFULL TO PO_FILE.
        G_F_CONF = G_C_XFELD.
      ENDIF.
    ENDFORM.                    " save_dialog
    If useful reward.
    Vasanth

  • Set default filename in JFileChooser (Save Dialog)

    Hi,
    how can i set a default filename in a JFileChooser-Save-Dialog?
    The file does NOT exist, so setSelectedFile(new File("FileName")); does not work.
    Thanks in advance.
    Filo

    Did you test this? It works fine for me.

  • Creating a DB_ENV environment/setting a directory path for db's in Windows

    I have a small visual studio 2005 c++ program where I am trying to specify which directory to open my database from. I use db_env_create to create my environment and then I try to use DB_ENV->set_data_dir to set my path but it keeps returning a non 0 number and not setting my path. Did I miss any steps?
    Thanks

    Here is an example that I tried and it is crashing at the set_cachesize.
    I don't set the cachesize it then crashes at the dbenv->open. Any idea why I am crashing? I am using Berkeley version 4.6.21 with Windows xp and visual studio 2005.
    Thanks.
    int ret;
    if ((ret = db_env_create(&dbenv, 0)) != 0)
         cout <<"Error Creating Database " << endl;
         return (1);
    if ((ret = dbenv->set_cachesize(dbenv, 0, 64 * 1024, 0)) != 0)
            cout << "Cache size error " << endl;
         dbenv->close(dbenv, 0);
         return (1);
    (void)dbenv->set_data_dir(dbenv, "C:\Documents and Settings");
    if ((ret = dbenv->open(dbenv, "C:\Documents and Settings\champ\My Documents\Visual  
         Studio 2005\Projects",DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | 
         DB_INIT_MPOOL | DB_INIT_TXN,0)) != 0)
           cout << "Cache size error " << endl;
           dbenv->close(dbenv, 0);
           return (1);
    }

  • How to set default directory for SQL LOADER

    hi all,
    i wanted to know how can we setup a default directory for SQL LOADER if at all we can. i connot place my control and data files in local system and use them at command prompt. rather i wanted to know if we can set default directory that the loader can use. this requirement is basically to enable all the clients to upload the data placed on the server and use the loader utility.
    thanks in advance,
    Basavraj

    Ella,
    You don't say which version of SQL Developer you are using via Citrix, but just setting the SQLDEVELOPER_USER_DIR hasn't worked for a long time (see Re: SQLDEVELOPER_USER_DIR does not function anymore). Also, since version 1.5, the default for the user directory (now set via ide.user.dir as shown below) is under the user profile area (relative to %APPDATA%), which you should be able to write to, even on Citrix.
    Assuming that neither of those help, you will need to get whoever installed SQL Developer on the Citrix C: drive to modify the sqldeveloper.conf to have a line like, where the path exists for everyone who will be using the shared SQL Developer (assumes everyone has a H: drive):
    AddVMOption -Dide.user.dir=H:\sqldeveloperAn alternative (depending on how you start SQL Developer via Citrix), is to create your own shortcut to start SQL Developer with something like:
    sqldeveloper -J-Dide.user.dir="%SQLDEVELOPER_USER_DIR%"theFurryOne

  • Dynamic Configuration - Set Directory Path for File Receiver Adapter

    Hi Experts,
    I have a question regarding the dynamic configuration for the file adapter. Is it possible to set a directory path without a message mapping for the file receiver adapter? the problem is that I want to import a pdf document. this pdf document I want to store in a dynamic directory (depending on the filename). so I have to read the filename out of the dynamic configuration and generate (depending on the filename) a directory for this file. Is that possible without a message mapping? I cannot make a message mapping because the file has the pdf format and should not get changed.
    best regards
    Christopher Kühn

    Hi Gaurav,
    I use the ASMA (respectively the filename) for the sender adapter. After the pdf was imported into XI this filename is in the ASMA.
    But what then??? How can I get this filename with the help of the variable substitution? and if I have this filename I have to change this filename a bit to generate the name / path of the directory.
    Please explain it to me detailled
    Thanks and regards
    christopher

  • Sun ONE Studio 4 aka Forte: How to set the output path for classes ?

    Help !
    Beginner's question:
    Sun ONE Studio 4 aka Forte:
    How to set the output path for classes ?
    As default, the class files are created in the same directory as the
    sources.
    In opposite, both JBuilder and Together support that there is a tree
    with the sources and another tree with the classes.
    The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
    a) Please point me to a ready-to-use ANT script for this purpose, if such is available
    b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.
    Tia
    Sincerely
    Rolf

    You can set S1S's options to place newly created .class files in a specific location.
    Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
    Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
    The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
    When you set the Target, your change affects all classes that use this compiler.
    Very few options can't be set in S1S; the challenge is finding out where they're set!

  • Setting a directory path

    I'm finding that I can only edit all the files within a directory that the program runs in. Is there a way of setting a directory path and being able to play with the files within.
    I've set the path with the "." before, but could not change anyything, not unless the program resides in the directory.
    I saw setdirectory(), method but couldn't get it to work, is this only for File chooser.
    File directory = new File(".");
    File[] files = directory.listFiles();
    for(int x = 0; x < files.length; x++)
                     if(files[x].isFile()) dim.addElement(files[x].getName());;
            }

    Java doesn't have anything like chdir command. You can use relative paths from the default path or you can use an absolute path in a File object.
    For example:
    new File("c:\\windows\\system32\\cmd.exe").rename("c:\\windows\\system32\\newname.exe");

  • Setting the parameter DIR_ORAHOME for a Dialog Instance

    I have been advised by the SAP GoLiveCheck to set the parameter DIR_ORAHOME for my dialog instances. The Oracle home is currently on the central instance at G:\oracle\SID\102. What must the path for the parameter DIR_ORAHOME be set to on the dialog instance? (central_host\.....???))
    Help.
    Scott

    Hello Scott,
    >> What must the path for the parameter DIR_ORAHOME be set to on the dialog instance?
    The paraemeter must be the same as on the database server itself. Set the DIR_ORAHOME in the default profile.. that is the way we do it.
    For example: /oracle/<SID>/102_64
    Regards
    Stefan

  • How to set up the path for report in 10gAS?

    I have a report which can be run in one folder A but not in the other folder B, both folder are included in the forms_path in default.env of AS. How can I set up the path for the report in AS so that the report server knows to look for the report in the folder B?

    Hello,
    If you don't specify the "full path name" for your reports, the file will be searched in the directories listed in REPORTS_PATH or in the directory specified in the property sourceDir
    For more details :
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/envvars/envvar_reports_path.htm
    and
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_conf.htm
    Regards

  • I want to get desktop path for client user using webutil

    oracle database 11g
    oracle forms 10 g
    client windows
    i want to get desktop path for client user using webutil
    as i want to save file in this path

    To get the user's path to their Desktop is a two step process.  First, you have to echo the %USERPROFILE% to a output file and secondly, read the directory from the output file in to Forms.  The code would look similar to the following:
    /* When-Button-Pressed trigger */
    DECLARE
      v_temp_path VARCHAR2(250);
      v_temp_file VARCHAR2(12) := 'webutil.log';
      f_file Client_Text_IO.File_Type;
    BEGIN
      Client_Host('cmd /c echo %USERPROFILE%\Desktop > c:\'||v_temp_file);
      f_file := Client_Text_Io.FOpen('c:\'||v_temp_file, 'R');
    Client_Text_Io.Get_Line(f_file,v_temp_path);
    Client_Text_Io.FClose(f_file);
       b_dummy := WebUtil_File.Delete_File('C:\'||v_temp_file);
      --At this point, you have the path stored in the v_temp_path variable.
      --You can assign this variable to a block item or reference it directly in your code.
    END;
    When you reference the value of the v_temp_path, don't forget to wrap the value in double-quotes (" ") becuase the path will have spaces.  Since your plan is to write a file to the user's desktop, your call to FOPEN will look  like this:
    f_file := Client_Text_Io.FOpen('"'||v_temp_file||'"','W');
    Hope this helps,
    Craig...

  • How to set default file path while downloading alv output

    Hi,
    Can anyone tell me that how to set default file path while downloading the ALV output to system using Local file button on tool bar.
    Please look below screenshots:
    Kindly help me resolve it.
    Thanks in advance.
    Regards,
    Ashutosh Katara

    This information initial value is (maybe) stored in Windows Register (register.exe) at Software\SAP\SAPGUI Front\SAP Frontend Server\Filetransfer -> PathDownload, you can read it thru class CL_GUI_FRONTEND_SERVICES method GET_UPLOAD_DOWNLOAD_PATH and update it thru method REGISTRY_SET_VALUE. (Else there may be some parameter ID to force data, but I'm no longer sure)
    Regards,
    Raymond

  • :-)  How can we change the default file path for Bank file ( dmee ) ?

    Hi All,
    We encounter a problem.
    Electronic bank file ( created after a F110 run ) are created, in an automatic way to the DIR_TEMP directory. ( On the SAP server )
    How can we change the default file path for Bank files ( dmee ) ?
    We'd like to specify another path.
    Thx for your help.
    Erwan

    Hello,
    Make sure that you have created the directory in transaction code AL11 with the help of basis consultants.
    You can link your PC directory to the application server.
    You can maintain the path whether your file needs to get saved in OBPM4 against your DMEE structure example GB_BACS etc.
    If you do not maintain any path in OBPM4, then the file gets saved to temporary directory. If you give the directory path name in OBPM4, then the file gets saved to that directory with numbers 0001, 0002, 0003 etc till it reaches 9999 and reset from the beginning.
    If you give the path as well as file name as ABCD, then the file gets generated to that directory folder with ABCD0001, ABCD0002, ABCD0003 etc. till it reaches ABCD9999 and reset from the beginning.
    Hope this solves your problem.
    Regards,
    Ravi

  • Set default grid artwork for composer grid view

    As the title I wanted to know if there is a way to set default grid artwork for composer grid view.
    Thanks.

    Nope. It is the first image from the first track of the first album that has artwork. As you move your pointer over the icon you will get any other images assoicated with that composer.
    tt2

Maybe you are looking for

  • Adobe Content Viewer Slow after Upgrade to ios 8

    Hi I am still in the development phase of my app. I have built it using InDesign. I have been updating and previewing the app in Adobe Content Viewer on my iPad 3. It was working fine. I upgraded my iPad to ios 8.1  three days back and since then the

  • TIFFs into pdf - Print to pdf - huge file size

    I have 16 pages scanned 11x17 tiff (b&w) images. I combine them in acrobat and save the file. Comes out ~2.6MB. I crop these images to remove black borders, white areas, whatever. Then I print to pdf (b&w), Fit to printable area at 11x17. With Acroba

  • Please help - Photos not saving

    I would appreciate some help here- the photos I take, screenshot, and try to save will not save to my camera roll. I can take, screenshot, and press the save button, but they won't save to the camera roll! I didn't update lately, (iPad is up to date)

  • Invalid Plug In causes Adobe to Close

    I have used Adobe 7.* and prior for years. I down loaded the latest version of Adobe, I think 8.1.2, and am unable to open PDF files with it. I get the following message: "An invalid plug in was detected. Adobe Reader will close.. I hit OK. Then I ge

  • What is Dashboard Client and how do I close it?  I use OSX Mavericks on my iMac.

    What is Dashboard Client and how do I close it?  I use OSX Mavericks on my iMac.