File Upload program with return value

Hello,
I have the following code in my Java program which I use to upload files and return the value of "filename" to the original opening window. Somehow there where changes which now invalidates this piece of code and gave a javascript error message of
"Error : Access is denied"
"Code : 0"
Here is the portion of the code where processing seems to stop.
fileOut.flush();
out.println("<script language='javascript'>");
out.println("this.window.opener.document.frm.sign2.value='" + saveFile + "';");
out.println("window.close()");
out.println("</script>");
out.println("<br> !!! File written " +
"<br> This is an attachment confirmation page" +
"<br> *** Please close this window ***");
More particularly the statement --> out.println("this.window.opener.document.frm.sign2.value=" + saveFile + ";");
As I have stated, this program worked before and returns the value to the opening window.
Now, it can still upload but doesn't not return the saveFile to the field sign2 of the opening window.
Any help or leads will be very helpful and appreciated.
Thanks very much.
Juan

No need of ; after window.close() ?

Similar Messages

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • Java program with return value, what is the best way?

    I was thinking something like this:
    public class A {
    public static int intMain(String... argv) {
    ///real program here
    public static void main(String... argv) {
    System.exit(intMain(argv));
    But System.exit does not await user threads and I use a library which creates threads where I do not have control.
    Is there a way to await every user thread without explicitly knowing them?

    I just want to return a value to the OS... zero in case of normal quit, non-zero in case of abnormal termination. I do not see anything complex in that. Actually it I think is crazy that Java mains are only void.
    About threads I use rabbitmq and it uses threads for its messaging. I noticed the problem because if I forget to correctly close rabbitmq objects the ``void main'' does not terminate while the ``int main'' does since system.exit does not wait.
    At the moment the question is more about curiosity, really there is no simple way to say ``await all users threads''?

  • File upload program by jsf

    I am doing one file upload program using
    <af:inputFile label="File to Upload" columns="90"
    value="#{FileProcessor.uploadedFile}"/>
    component..
    in Jdeveloper 11g i am getting the correct result,
    but when i'm tryin to run it in Jdeveloper jdevstudio10131 it is giving this error.
    java.io.EOFException: Per-request disk space limits exceeded. at oracle.adfinternal.view.faces.webapp.UploadedFileImpl.loadFile(UploadedFileImpl.java:187) at
    i want this file upload application to run in ecplise..but there it is not working..do i need so some to import some jar files??
    tomat 5.0 i'm using there..
    Or is there any otherway to upload file using jsf component which should work in eclipse-tomcat enviornment also..
    please help
    thanks

    Mr BalusC,
    Yes Iam talking about a custom made upload component. The fileupload tutorials u send are good but my requirement is not meeting them. Among my requirements one is mutilple file uploads in the single view page. This is possible at present with my custom upload componet. Only if the problem gets solved. Any way once again please think on my problem and give your solution on it.
    Here is my problem:
    The problem is I have to access the components from view page which this kind of requirement possible in jsp by request parsing which results the key value pairs of the form components. This same thing/way I should get in backing bean from JSF view page.
    The solution I want may like as follows.
    Note this code is incorrect and wrong but for to understand my requirement.
    someobject.getComponentIdValue("clientID"); which returns a string value as d:\images\Tutle.jpg
    The clientID is upload file component' Id . In the request it may be the key associated with value as file complete path. By this kind of way my upload filter is able to get the orignal file. Ok i need this in my  backing bean to get the orignal filename to insert into the database. Please for this give the solution or reply.many thanx,
    vijaycanaan.

  • HI Masters , I need information for file upload program in web dynpro java

    Hi masters,
           i need some inforamtion and documentation on file upload program in web dynpro java

    Hi surya,
    You can follow this procedure to upload the file
    i) Take One Context Attribute named as "D1" of Type "binary".
    ii) Take one FileUpload UI Element in the Layout Tab.
    iii) Bind FileUpload UI Element's data Property to the taken Context Attribute. Here it is "D1".
    iv) Take one Button UI Element in the Layout Tab named "Upload" and in the Action of that Button write the following Code.
    v) The following code Generates one Folder in the Server & inside that Folder given file is Uploaded.
    File ff=new File("FolderXYZ"); // Creates One Folder with the given Name ( Here Folder name is "FolderXYZ")
    ff.mkdir();
    try
    byte b[]=null;
    IWDAttributeInfo objAttinfo=null;
    IWDModifiableBinaryType binType=null;
    File f=null;
    FileOutputStream fos=null;
    if(wdContext.currentContextElement().getD1()!=null)
    b=wdContext.currentContextElement().getD1();
    objAttinfo=wdContext.getNodeInfo().getAttribute(IPrivateAttachView.IContextElement.D1);
    binType=(IWDModifiableBinaryType)objAttinfo.getModifiableSimpleType();
    f=new File(ff.getName()+"
    "+binType.getFileName());
    fos=new FileOutputStream(f);
    fos.write(b);
    fos.flush();
    fos.close();
    objMessageManager.reportSuccess("File uploaded to server");
    } catch (Exception e)
    objMessageManager.reportException("Unable to upload file to server, error is:"+e,false);
    return;
    The Uploaded file is stored in the folder & that folder is stored in the Server's following Path.
    <Your Server>\c$\usr\sap\J2E\JC00\j2ee\cluster\server0
    You can access your Uploaded file from the following Path
    <Your Server>\c$\usr\sap\J2E\JC00\j2ee\cluster\server0\FolderXYZ
    Regards
    Sagar Ingalwar

  • File upload conflict with BC4JRequestProcessor under 10g

    Hello.
    I'm using file upload in application designed in JDeveloper 9i with STRUTS framework. Request processor is BC4JRequestProcessor. Application uses file upload performed with form derrived from ActionForm with property of interface FormFile. Everything was OK until migration to 10g was performed. Under 10g, the NullPointerException is reported in MultipartUtil class called from BC4JRequestProcessor. Details:java.lang.NullPointerException
    at oracle.jbo.html.struts11.MultipartUtil.populate(MultipartUtil.java:227)
    at oracle.jbo.html.struts11.BC4JRequestProcessor.processPopulate(BC4JRequestProcessor.java:433)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
    ...The problem is, that method "populate" of MultipartUtil class doesn't resolve the MultipartRequestHandler parameter and the names of the parameters (Enumeration names) has than a null value. There is a NullPointerException thrown after an attempt of iteration of this enumeration.
    Any suggestions?
    Thanks.

    just found this thread
    BC4J MultipartRequestHandler is null

  • .CSV File upload  program in CCM

    HI Gurus,
    Is there any possibility of calling file upload program from another program which should pick the file stored in server and upload as we do it in manually selecting the supplier and upload the .csv file by specifying the path.Kindly advice.
    Thanks and Regards,
    Sathya kumar.

    Hi
    I have not tried this.. But i guess it's possible.
    What's your detailed business requirement ?
    Do let me know.
    Regards
    - Atul

  • ADF Code Corner 069 : problem with returned value

    Hello,
    I use jdeveloper 11.1.2.2.0 and am trying to follow the sample 69 from ADF Code Croner : how-to create a custom LOV using bounded task flows. http://www.oracle.com/technetwork/developer-tools/adf/learnmore/69-custom-lov-with-btf-276178.pdf
    I have a problem with the returned value. The correct value is returned in the inputText but it seems that it is just at UI level and that binding layer is not impacted. If user click on next button, all others rows show the same value in the inputText (the value chosen before in the lov), and not the correct value which must be value from db.
    How can I solve this problem?
    note : opening the 69-sample, jdeveloper ask me to migrate some files (jpr/jws) from previous version of jdeveloper.
    Edited by: h0s on 8 oct. 2012 06:14

    Yes It happens with the downloaded sample. You can do this test :
    Launch EmployeesForm activity -> Open the LOV and select a department -> click next and see that the department id is the same for all rows.
    jdeveloper 11.1.2.2.0

  • Problem with return value of stored function

    Hi,
    I've made a stored function that insert a new row in a table and return the primary key (see at the end of the message the function script).
    In VS 2005 with Visual basic, using the designer, I've created a dataset containing a tableAdapter to be able to use the Pl/SQL function.
    My problem is I can't get the proper return value. The VB code below works without error except that I get 0 as value.
    What's wrong?
    Cheers,
    Sebastien
    VB code
    Dim myAddSession As New ICISDataSetTableAdapters.AddSessionTableAdapter
    Dim intSessionId As Integer
    intSessionId = myAddSession.ADD_SESSION(tbxUsername.Text, _
    tempFolder.Substring(tempFolder.LastIndexOf("\") + 1), _
    "toto", Environment.GetEnvironmentVariable("COMPUTERNAME"), _
    myLevelAccess.icisUserId, myLevelAccess.levelId)
    The debugger tells me that the ADD_SESSION function return value is Object.
    add_session PL/SQL script:
    CREATE OR REPLACE FUNCTION ICISSEC.add_session (
    orausername IN icis_session.ora_user_name%TYPE,
    ctxsessionid IN icis_session.ctx_session_id%TYPE,
    ctxsessionname IN icis_session.ctx_session_name%TYPE,
    ctxservername IN icis_session.ctx_server_name%TYPE,
    icisuserid IN icis_session.icis_user_id%TYPE,
    startlevelid IN icis_session.start_lvl_id%TYPE
    RETURN icis_session.ICIS_SESSION_ID%TYPE
    IS
    tmpvar icis_session.ICIS_SESSION_ID%TYPE;
    BEGIN
    INSERT INTO icis_session
    (ora_user_name, ctx_session_id, ctx_server_name,
    icis_user_id, start_lvl_id, ctx_session_name
    VALUES (orausername, ctxsessionid, ctxservername,
    icisuserid, startlevelid, ctxsessionname
    RETURNING icis_session_id
    INTO tmpvar;
    COMMIT;
    RETURN tmpvar;
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END add_session;

    naama wrote:
    that if a value is null to convert it to 0 ? . i mean in the part of the declaration of parameter
    Nope, can't do that in the signature. You'll need to handle that by validating the passed parameters at the start of the function.
    It's simple enough. In your case you might just as well test for NULL and fail the function like this:
        FUNCTION date_post_message(
                user_lock_in IN NUMBER,
                form_type_in IN NUMBER DEFAULT 0 ,
                date_in      IN DATE)
            RETURN BOOLEAN
        IS
            v_num NUMBER(1);
        BEGIN
            dbms_output.put_line('Value of parameters : user_lock_in : '||user_lock_in || ' : form_type_in : '||form_type_in||' : date_in : '||date_in );
            IF user_lock_in = 1 THEN
                RETURN FALSE;
            END IF;
            IF form_type_in IS NULL THEN
                RETURN FALSE;
            ELSIF form_type_in NOT IN (1,2) THEN
                RETURN FALSE;
            END IF;
            RETURN TRUE;
        EXCEPTION
        WHEN NO_DATA_FOUND THEN
            RETURN FALSE;
        END;In other use cases I would declare a local variable and process it like this:
            IF form_type_in IS NULL THEN
                l_form_type := 0;
            ELSE
                 l_form_type := form_type_in;
            END IF;Obviously the code should use the local variable rather than the parameter.
    Validating the values passed in parameters at the start of a function is good practice. If you really want to go to town, read about Design By Contract.
    Cheers, APC
    Edited by: APC on Nov 9, 2011 1:36 PM
    Added example, as requested by OP

  • Interakt File Upload incompatible with Firefox?  Recommend ASP Upload tool?

    Hi,
    I've been using Interakt's File Upload tool for quite some
    time but have
    recently been made aware that it doesn't work in Firefox!
    Anyway, I notice that Interakt no longer exist now, having
    been bought out
    by Adobe some time ago as it turns out.
    Has anyone experienced this problem and found a solution?
    Adobe aren't
    offering any support for the Interakt products and no-one is
    answering, or
    even looking at, their forums.
    My feeling is that I'll need to just scrap the Interakt
    extension and try
    something else? Can anyone recommend a good File Upload
    extension for
    Dreamweaver ASP/VBScript?
    Please do not recommend DMX Zone as I am looking for a
    company that actually
    provides customer support for their products!
    Thanks for any advice offered. Much appreciated
    Nath.

    Hi Joris,
    Is the Adobe Dreamweaver Developer Toolkit included with
    Dreamweaver CS3?
    I'm using Dreamweaver 8.0.2 at the moment, but I would
    upgrade to CS3 if it
    included the Developer Toolkit. If not, it would appear that
    Adobe want
    $299 for it, although I'm in the UK, so it'll probably be
    double that! :o(
    I was previously using Interakt's File Upload
    behaviour/extension, but the
    re-direct code isn't Firefox compatible, so it doesn't
    re-direct correctly:
    <!--#include file="includes/common/KT_common.asp" -->
    <!--#include file="includes/tNG/tNG.inc.asp" -->
    <%
    'Make a transaction dispatcher instance
    Dim tNGs: Set tNGs = new tNG_dispatcher
    tNGs.Init ""
    %>
    <%
    'start Trigger_FileUpload trigger
    'remove this line if you want to edit the code by hand
    Function Trigger_FileUpload (ByRef tNG)
    Dim uploadObj: Set uploadObj = new tNG_FileUpload
    uploadObj.Init tNG
    uploadObj.setFormFieldName "imageone"
    uploadObj.setDbFieldName "imageone"
    uploadObj.setFolder "itemphotos/"
    uploadObj.setMaxSize 1000
    uploadObj.setAllowedExtensions "jpg, gif, jpeg"
    uploadObj.setRename "auto"
    Set Trigger_FileUpload = uploadObj.Execute()
    End Function
    'end Trigger_FileUpload trigger
    %>
    <%
    'start Trigger_Custom trigger
    Function Trigger_Custom (ByRef tNG)
    query = "SELECT rowID FROM table WHERE rowID = " &
    Session("rowIDsess")
    On Error Resume Next
    Set rsCheck = tNG.connection.Execute(query)
    if (Err.Number <> 0) OR (Not rsCheck.EOF) then
    KT_redir("confirmation.asp")
    else
    Set Trigger_Custom = nothing
    end if
    On Error GoTo 0
    End Function
    'end Trigger_Custom trigger
    %>
    As you can see, it should redirect to confirmation.asp, but
    this doesn't
    work in Firefox - it just loads a blank white page! Do you
    have a re-direct
    selected in your form using Kollection 3.7.1? Does it work?
    Is my code
    vastly different to what you've got?
    I purchased Advanced HTML Editor from DMX Zone, experienced a
    problem with
    it, sent e-mails and posted on their forum. I did not receive
    ONE reply. I
    won't be back.
    Would appreciate any help you could offer.
    Thank you.
    Nathon.
    > Some of the interakt products are now sold as Adobe
    Dreamweaver Developer
    > Toolkit,
    > using Kollection 3.7.1 I can't reproduce not being able
    to upload in
    > Firefox on Mac and Windows.
    >
    > I have good experiences with DMXZone support, why are
    you suggesting
    > they're not providing support?

  • File upload: problem with writing uploaded file to server-harddisk

    Hello,
    according to the example in the File upload tutorial, I tried to save an uploaded file to disk, but it didn't work (and also no messages / exceptions were thrown).
    The Javadoc for the function uploadedFile.write(filename) says that if the file should be written in an other directory than the servers' tmp-directory, the server.policy has to be adjusted.
    The following line is already included in my server.policy:
    permission java.io.FilePermission "<<ALL FILES>>", "read,write";
    So I have two questions:
    1) Where can I find the servers' tmp-directory?
    2) How should the sever.policy permission code look like?

    The File Upload tutorial at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/file_upload.html has you save the uploaded file to disk. It also gives this information:
    The server holds the uploaded file in memory unless it exceeds 4096 bytes, in which case the server holds the file contents in a temporary file. You can change this threshold by modifying the sizeThreshold parameter for the UploadFilter filter entry in the web application's web.xml file. For more information on modifying the web.xml file, see the last section in this tutorial, Doing More: Modifying the Maximum File Upload Size.
    In cases where you want to retain the uploaded file, you have three choices:
    * Write the file to a location of your choosing, as shown in this tutorial.
    * Create an UploadedFile property in a managed bean and set it to the component's value before you exit the page (as in the button's action method).
    * Save the file to a database.
    By default, the File Upload component can handle files up to one megabyte in size. You can change the maximum file size by modifying the maxSize parameter for the UploadFilter filter entry in the application's web.xml file, as described in the last section in this tutorial, Doing More: Modifying the Maximum File Upload Size.

  • Data not indexed after running HV file upload program

    hello
    we using TREX 7.1
    we rae runing CRM_MKTTG_FDS_LOAD_FILE program
    I've did a sample test with just 11 rows of data based on the original
    file I have in TREX and CRM_MKTTG_FDS_LOAD_FILE program completed and
    11 records are indexed.
    However when I run the program with the same file format with
    a much more bigger set of data, the job finished with a time out error
    and when I checked TREXADMIN, none of the data get indexed. Both sample
    file and the orginal file have the same format and both datasource
    configured the same way.
    can somebody gine us a hint? appreciate your quick respose guys!

    Hello,
    What version of LabVIEW and of Microsoft Office are you using? I recommend that you use the latest version of both, since I found a few references about this error occurring with older versions of LabVIEW. Also, there are some example VIs that ship with LabVIEW for communicating with Excel through ActiveX...have you tried those examples to see if they work? If they work, there might be a problem with your implementation of the ActiveX functions in your program.
    I hope one of these suggestions helps. Please let me know if you continue to have any problems.
    Good luck, and have a pleasant day.
    Sincerely,
    Darren Nattinger
    Applications Engineer
    National Instruments
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • File Upload- problem with IE

    I am using commons file upload:
    When I do item.getName() I am getting the name of the file(When I use Mozilla Browser).
    But with IE I am getting the full path instead of name of file.
    So this creates the issues while uploading.
    Can any one help me out with this.
    Thanks
    Aniketh

    Just trim off the file path? The java.lang.String API offers useful methods for that.
    Also see http://balusc.blogspot.com/2007/11/multipartfilter.html for an example.

  • Flex file upload issue with large image files

         Hello, I have created a sample flex application to upload an image and also created java servlet to upload and save image and deployed in local tomcat server. I am testing the application in LAN. I am able to upload small as well as large image file(1Mb) from some PCs but in some other PCs I am getting IOError while uploading large image files however it is working fine for small images. Image uploading is hanging after 10%-20% and throwing IOError. *Surprizgly it is working Ok with XP systems and causeing issues with Windows7 systems*.
    Plz give me any idea to get a solution.
    In Tomcat server side it is giving following error:
    request: org.apache.catalina.connector.RequestFacade@c19694
    org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
            at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:371)
            at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.ja va:126)
            at flex.servlets.UploadImage.doPost(UploadImage.java:47)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
            at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
            at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProto col.java:594)
            at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
            at java.lang.Thread.run(Thread.java:722)
    Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly
            at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStre am.java:982)
            at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:8 86)
            at java.io.InputStream.read(InputStream.java:101)
            at org.apache.commons.fileupload.util.Streams.copy(Streams.java:96)
            at org.apache.commons.fileupload.util.Streams.copy(Streams.java:66)
            at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:366)
    UploadImage.java:
    package flex.servlets;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    import java.util.regex.*;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.*;
    import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class UploadImage extends HttpServlet{
             * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
             *      response)
            protected void doGet(HttpServletRequest request,
                            HttpServletResponse response) throws ServletException, IOException {
                    // TODO Auto-generated method stub
                    doPost(request, response);
            public void doPost(HttpServletRequest request,
                            HttpServletResponse response)
            throws ServletException, IOException {
                    PrintWriter out = response.getWriter();
                    boolean isMultipart = ServletFileUpload.isMultipartContent(
                                    request);
                    System.out.println("request: "+request);
                    if (!isMultipart) {
                            System.out.println("File Not Uploaded");
                    } else {
                            FileItemFactory factory = new DiskFileItemFactory();
                            ServletFileUpload upload = new ServletFileUpload(factory);
                            List items = null;
                            try {
                                    items = upload.parseRequest(request);
                                    System.out.println("items: "+items);
                            } catch (FileUploadException e) {
                                    e.printStackTrace();
                            Iterator itr = items.iterator();
                            while (itr.hasNext()) {
                                    FileItem item = (FileItem) itr.next();
                                    if (item.isFormField()){
                                            String name = item.getFieldName();
                                            System.out.println("name: "+name);
                                            String value = item.getString();
                                            System.out.println("value: "+value);
                                    } else {
                                            try {
                                                    String itemName = item.getName();
                                                    Random generator = new Random();
                                                    int r = Math.abs(generator.nextInt());
                                                    String reg = "[.*]";
                                                    String replacingtext = "";
                                                    System.out.println("Text before replacing is:-" +
                                                                    itemName);
                                                    Pattern pattern = Pattern.compile(reg);
                                                    Matcher matcher = pattern.matcher(itemName);
                                                    StringBuffer buffer = new StringBuffer();
                                                    while (matcher.find()) {
                                                            matcher.appendReplacement(buffer, replacingtext);
                                                    int IndexOf = itemName.indexOf(".");
                                                    String domainName = itemName.substring(IndexOf);
                                                    System.out.println("domainName: "+domainName);
                                                    String finalimage = buffer.toString()+"_"+r+domainName;
                                                    System.out.println("Final Image==="+finalimage);
                                                    File savedFile = new File(getServletContext().getRealPath("assets/images/")+"/LowesFloorPlan.png");
                                                    //File savedFile = new File("D:/apache-tomcat-6.0.35/webapps/ROOT/example/"+"\\test.jpeg");
                                                    item.write(savedFile);
                                                    out.println("<html>");
                                                    out.println("<body>");
                                                    out.println("<table><tr><td>");
                                                    out.println("");
                                                    out.println("</td></tr></table>");
                                                    try {
                                                            out.println("image inserted successfully");
                                                            out.println("</body>");
                                                            out.println("</html>");  
                                                    } catch (Exception e) {
                                                            System.out.println(e.getMessage());
                                                    } finally {
                                            } catch (Exception e) {
                                                    e.printStackTrace();

    It is only coming in Windows 7 systems and the root of this problem is SSL certificate.
    Workaround for this:
    Open application in IE and click on certificate error link at address bar . Click install certificate and you are done..
    happy programming.
    Thanks
    DevSachin

  • File upload interface with gui_upload

    Hi Experts,
    I am trying to use the method GUI_UPLOAD of the class CL_GUI_FRONTEND_SERVICES.
    But the problem is I am not getting a dialog box where we can select the file by browsing our computer.( like the browse button in Windows).
    I remember getting this dialog box when using the FM WS_UPLOAD.
    But this is obsolete and cannot use in Unicode programs.
    What should I do? and how?
    can anybody help me?
    Thanks in advance.
    Goldie.

    May be this way
    * At selection screen event                                            *
    at selection-screen on value-request for p_file1.
      perform f_get_f4_filename using p_file1 changing p_file1.
    *  Form f_get_f4_filename                                              *
    * For F4 help for file name                                            *
    form f_get_f4_filename using pfile changing pfile1.
    * Private Variables
      data :v_subrc     type i.
      refresh : i_file1. clear i_file1.
      call method cl_gui_frontend_services=>file_open_dialog
        exporting
          window_title            = 'Select Files'
          default_extension       = '*.xls'
          default_filename        = '*.xls'
          initial_directory       = 'c:'
          multiselection          = ' '
        changing
          file_table              = i_file1
          rc                      = v_subrc
        exceptions
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          others                  = 5.
      if sy-subrc eq 0.
        loop at i_file1 assigning <fs>.
          pfile1 = <fs>.
          exit.
        endloop.
      else.
        message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                                 " F_get_f4_filename

Maybe you are looking for