Modifying the name of a file generated by a servlet

Hi!
I have a servlet called co.com.SomeStaff who reads a binary file from the server an responses it to the client, but the name that appears when the browser tries to save it is "co.com.SomeStaff" and I need the "SomeBinariFile.exe" instead. How can iI do this?
I've tried to modify the Headers but....
I need it as soon as posible.
Thanks All.

I assume you are creating the file as a java.io.File object. Under those circumstances you should be able to specify the name and target directory when you save it:File f = new File(directory+System.getProperty("file.separator")+filename);Or, if you have already named it:
f.renameTo("file.txt");Actually, now I look at it, I may have totally misunderstood what you are trying to do there- are you naming it right in the hyperlink?

Similar Messages

  • Can I modify the name of UUT report

    Hi, I am a new one of TS! Can I modify the name of UUT report? Who can help me. Thanks in advance!
    Under Normal Circumstances, I finish the UUT test,TS generating the report like this"Report[4F492CAB04][13 29 06][2012-11-28].html".
    Can I modify something,When TS generating report will like this"Report[4F492CAB04][13 29][2012-11-28].html" without the seconds!
    Solved!
    Go to Solution.

    Ivrat, Thank you for your reply! This way can modify the name of UUT report certainly!
    But, it is difficult to me deal with deleting seconds when use functions(like SerachAndReplace) !
    In these days I also find another way to solve this problem and I think your way much better than mine! Can you show me more details about use functions to solve this problem!
    My way show as below:
    1.Find this file"SequentialModel.seq". The path is"C:\Program Files (x86)\National Instruments\TestStand 2010\Components\Models\TestStandModels" .
    If you are using TS2012,the path is"C:\Program Files (x86)\National Instruments\TestStand 2012\Components\Models\ModelPlugins\NI_ReportGenerator.seq"
    2.You can find "Determine Report File Path Expression"
    3.Use function Left(Time(),5)

  • Can we get the name of fmx file at runtime

    Hi all,
    can we get the name of fmx file which is doing some DML operation on a specific table Can we back track which fmx module has done DML on a specific table. The reason I need this because I've 7 different fmx files which are doing some DML operation on a specific table and these fmx files were used by different users. Not necessarily 1:1 For eg. one user can do DML through 3 different fmx files. So in such case if I want to want to know from which fmx file this DML has take place .How can I achieve that. I know I can get the oracle username through v$session but it will not suffice my needs. I need the name of fmx file also.
    I'm using:
    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Any help?
    Warm Regards
    Percy

    Percy,
    For that you can set the Module Field in the V$session in each form by,
    DBMS_APPLICATION_INFO.SET_MODULE(MODULE_NAME => :SYSTEM.CURRENT_FORM, ACTION_NAME => USER);Write this in each form, and then you will get the form name in the V$SESSION's module field with form name.
    Hope this helps.
    Regards,
    Manu.

  • Change the name of a file.

    Hello, I don't how can I change the name of a file ?.
    Somebody can help me, please?
    For example : c:\out\prove1.csv to  c:\out\prove1_09112007_163001.csv
    Thanks

    Another way would be to use the FILE_COPY and
    FILE_DELETE of the class CL_GUI_FRONTEND_SERVICES to first copy the file and then delete the other one.
    REgards,
    Rich Heilman

  • BEx Brodcaster for Workbook - Cannot change the name of attachment file.

    Dear All Experts,
    I am using the BEx Broadcaster to distribute report of workbook via email. The name of attchament file in email is the technical of workbook. I want change the name of attchment file and found this thread
    [Broadcasting Workbook - Change attachment filename|Broadcasting Workbook - Change attachment filename] that reference to method in background process. Can I create customize program or method to change the name of file.
    Thank you and really appreciate your help.
    Zilla D.

    Hello Zilla,
    By SAP methods, this is not possible. There is no way to do that. May you can suggest it on our Community of Innovation. See note 11.
    This is not only your concern. Some customers already request this functionallity.
    Best Regards,
    Edward John

  • When I click on the Start Icon and type the name of a file I am searching for none appear.

    When I click on the Start Icon and type the name of a file I am searching for none appear.
    Using Widows 7

    Are you searching for a file that you downloaded via Firefox?
    If that is the case then you can check the Download Manager (Tools > Downloads) and if that file is listed there then right click that entry and choose > Open Containing Folder. If that entry is grayed then the file is no longer in the original download location and possibly removed by AV software.

  • How to modify the names of existing Pages styles?

    In Pages 5.5.2 under Yosemite 10.10.2.
    1. How to modify the name of an existing style in both the Main styles list, and also in the Bullets & Lists styles list?
    2. How to delete unwanted styles from both styles lists?
    3. How to modify the default formulas for Bullets & Lists styles and make them stick for future documents?
    Appreciated.

    Click on it and you get the Formatting options for the selected text.
    If I had meant the Menus, I would have added that, but all the above is what you see when you have a document open in Pages 5.5.2.
    The > are clearly progressive steps. Except for the ">" which appears in the pop up menu, so I put it in quotes.
    I always assume that people on the forum will make some effort themselves, but can bring it down a notch if needed.
    Peter

  • Modifying the name of the file in the download dialog box

    Hi all!
    I've a javascript page that make a pdf document in the fly and download that document. Everything is fine, but I'd like to know how can I modifying the file name in the download dialog box, i.e., when the page display:
    "You are downloading the file:
    xpto.jsp from ..."
    I want to substitute the "xpto.jsp" by "file.pdf".
    I've already theses lines:
    response.setContentType("Application/pdf");
    response.setHeader("Content-Disposition", "attachment; filename="+ nameFile+";");
    response.setHeader("Content-Length", ""+stp.length);
    but the problem persist.
    Note that in the second window, the Save As window, everything is fine, the nameFile appears in the file name box. The problem it's only in the first window, the File Download window.
    Thanks for any help,
    A. Santos

    I've discover something. When the File Download window it's displayed with the following text:
    "You are downloading the file:
    xpto.jsp from localhost
    Would you like to open the file or save it in your computer?
    button OPEN button SAVE button CANCEL button MORE INFO"
    if I press the OPEN button then another File Download window opens with the rigth text:
    "You are downloading the file:
    file.pdf from..."!!!
    i.e, the text desired!
    So the first window is unnecessary and undesired!
    How can I remove this first File Download window??
    Please help!
    A. Santos

  • How to create a record based on the name of a file in the file-system?

    Hi,
    With a lot of pictures I want to have a database to gather some information about these pictures.
    First question is how to generate a record based on a file in the file system?
    e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
    now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
    any suggestions?
    any reaction will be appreciated.
    Leo

    Link to Create directory
    http://www.adp-gmbh.ch/ora/sql/create_directory.html
    You can create a list of files in the directory and read the list files from that directory.
    [UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
    [Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
    SS

  • How do I determine the name of a file from a watched folder

    I would like to generate a log to track the names and outcomes of files processed from a watched folder.  I don't see a way to access the name of the file from within the process.  I have a variable "inPDF" which is data type "document" and "outResult" which is type "xml" but I don't see a way to access the file name (or path) of the "inPDF" "document" object.  Is there a way to access the file name and path?

    Thank you, this sounds promising.
    Where can I find documentation describing the attributes that can be retrieved using the getDocumentAttribute function?  Also, where can I find a complete reference on the Document object?
    Best Regards,
    Noam

  • How to modify the field lengh of file upload

    Hi All,
       I am facing a problem with u201Cuploadu201D filed length in BSP application.
    When we upload the file in BSP page, the path displayed should be the full path (i.e. from where the file is being upload the file)
    Now this field is appearing 20 char length
    Now I want to increase the length of the upload field (Input field) to be 100 char so that the path is visible.
    In the current application the file upload is being done through a structure (attributes)
    In this structure the fields are like this
    PAGE_NAME
    ID
    FOR
    TAGS
    ROW_INDEX
    COLUMN_INDEX
    OTR_NAME
    REQUIRED_NAME
    MAXLENGTH
    SIZE
    TABLE_NAME
    ON_SELECT
    VALUE
    DISABLED
    ONCLICK
    TEXT
    TYPE
    Using this method:
    CALL METHOD cl_htmlb_fileupload=>factory
              EXPORTING
                Id      = ls_form_save-id
              RECEIVING
                Element = lv_fileup.
            bee_table->add ( level = 2 element = lv_fileup ).
    This cl_htmlb_fileupload is named as class interface.
    Which has the CLG_HTMLB_FILEUPLOAD (it is a class) it is defined in attributes.
    In this class it has the attribute u201CSIZEu201D by default string 20.
    Now I need to change this attribute length from 20 to 100
    For this I copied the standard class CL_HTMLB_FILEUPLOAD into ZCL_HTMLB_FILEUPLOAD.
    This ZCL_HTMLB_FILEUPLOAD contains all attributes of the standard class CL_HTMLB_FILEUPLOAD
    Including the one class (CLG_HTMLB_FILEUPLOAD), this is defined as an attribute (ABOVE MENTIONED?)
    This class is appearing in non editable mode, so   I have copied this class into zclass (ZCLG_HTMLB_FILEUPLOAD).but still I am not able to edit the attribute called u201Csizeu201D
    And also I am not bale to add the zclass in place of the ZCLG_HTMLB_FILEUPLOAD
    Kindly tell me how to modify the length of the field u201Csize u201Cand also how to add the zclass in the attributes of one class (syntax)
    Thanks in advance
    Rambabu.A

    Hi,
    Class CLG_HTMLB_FILEUPLOAD is a class automatically generated when a BSP Element is created. You should not change/create such a class, unless by creating your own BSP Element.
    As per your requirement, you can use the SIZE parameter of method factory:
    ls_form_save-size = '100'.
    CALL METHOD cl_htmlb_fileupload=>factory
    EXPORTING
    Id = ls_form_save-id
    Size = ls_form_save-size
    RECEIVING
    Element = lv_fileup.
    Regards,
    Tanguy

  • Name of .exe file generated from Air Help

    Is there a way to customize the name of the .exe file generated by the Air Help output? I can specify the name of the .air file. But when the Air application is installed, the .exe filename is the same as the help title ("Help Title" field in the Adobe Air dialog box) . This means the help title is used in the title bar of the Air application, on the Start menu and Add/Remove Programs, and in the filename.
    I would like to use a shorter, one-word filename. I would expect the name of the .air file to be the name of the .exe file.
    I'm generating an Adobe Air application using RoboHelp 8.
    Thanks,
    - Maura

    I assume you are creating the file as a java.io.File object. Under those circumstances you should be able to specify the name and target directory when you save it:File f = new File(directory+System.getProperty("file.separator")+filename);Or, if you have already named it:
    f.renameTo("file.txt");Actually, now I look at it, I may have totally misunderstood what you are trying to do there- are you naming it right in the hyperlink?

  • Why is the name of java file is same as public class?

    hello friends
    why we need to assign same name to .java file as the name of public class in .java file? while its not necessary for the class having no modifier?

    This question has been asked several times. Serch the forum.
    x

  • How can I find the name of a file I downloaded four months ago?

    I downloaded a file on either February 15th or 16th. Embarrassingly, I've lost the file, simply by forgetting its name. I need to be able to search my download history, by date. Does anyone know of a way to do this? I know that the history is kept that long, and that I haven't erased the history. Finding the date that I visited the website was easy using history and an approximate date, but download history is less intuitive.
    And, no, revisiting the website doesn't help; the only way to find the name of the file there (it's an ebook) is to buy it again, which is NOT what I wish to do.
    This was in Windows 7 Home Premium Edition, with FireFox v. 28.0 (yes, I know it's outdated; I haven't been using that computer much lately). I don't know what version of FireFox was installed at the time of the download -- whatever was most current at the time, as I usually make a practice of installing updates.

    The downloads folder in the history manager? I'm not sure what you mean.
    When I click on History, I see what I've put in the screenshot. Then it starts telling me where I've been today. Nothing about downloads, per se. I've been getting at those through Tools/Downloads.
    I have FireFox set up to ask me where downloads should go, rather than automatically sending them to my Downloads folder in Windows, and even if it had automatically saved to Downloads, it wouldn't still be there now.
    In a pinch, I suppose I could skip the first few in the downloads list, and then start right-clicking on individual downloads and selecting Go To Download Page, but I was hoping there might be some way to narrow it down, by getting at the date on downloads. That's fairly easy in History, but I don't see any way to do it in Tools/Downloads.

  • How to read the name of .csv file from a particular folder using Oracle.

    Gurus,
    I have a folder called 'data_dir' in Oracle Server and it contains 10 different .csv files and the name of the each file is being suffixed by date and time(24 hrs format).
    First i need to read all the file names then i have to process those files by UTL_FILE to load the data into a relational table.
    Is there any mechanism is available in Oracle to read the file names?
    (In this case all the 10 different csv file names)
    If so, then please help me accomplish this.
    Thanks in advance.
    Regards,
    Venugopal.K

    Is there any mechanism is available in Oracle to read the file names?Sounds to me like you need to use External Tables (*not* utl_file).
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/et_concepts.htm

Maybe you are looking for

  • How to change data in an Email

    In BW BPS (v3.5), how can you add details to the email(s) that are generated?

  • Code View Scroll Bar Jumps + High Processor usage

    In Code View, if you click at the bottom of the page -if the vertical scroll bar is present- the scroll bar jumps one or two lines up. I know about another bug i.e Dw uses 15 to 30% of the processor at all times, I hope it'll get fixed soon or I'll h

  • Rebates (Subsequent settlement) settling to Debtor?

    Hi, I currently am trying to configure the MM Subsequent settlement process. The business does not want to create a credit item on the suppliers account and would prefer to settle the rebate back to the suppliers customer account with us.   Is this p

  • How wide to make a website in pixels?

    Haven't made a website in a WHILE, and I realize the game has changed. How many pixels wide are people designing at these days, as a rule of thumb?

  • Having problem with calling external javascript functions in LV

    Hi, I found this VI: http://lavag.org/topic/10304-discuss-calling-external-javascript/, which I believe can be really helpful for my work. The problem is I can't get it to run based on the following problem:  - Apparently the "ScriptControl" cannot b