Skip to Content
author's profile photo Former Member
Former Member

File Upload - Calling bls via JSP

I'm using the following jsp to upload a document and call a bls transaction

<%

boolean isMultipart = DiskFileUpload.isMultipartContent(request);

DefaultFileItemFactory factory = new DefaultFileItemFactory();

DiskFileUpload upload = new DiskFileUpload(factory);

List /* FileItem */ items = upload.parseRequest(request);

Iterator iter = items.iterator();

while (iter.hasNext()) {

FileItem item = (FileItem) iter.next();

if (!item.isFormField()) {

String fileName = item.getName();

String contentType = item.getContentType();

File uploadedFile = new File("\\\\Livadmmdvci1\\MII_Backups\\Upload\\" + fileName.substring(fileName.lastIndexOf("\\") + 1));

item.write(uploadedFile);

String site = new String("/XMII/Runner?Transaction=CustomerComplaintTracking/UploadFile-b&FILETYPE=" + contentType + "&FILENAME=" + (fileName.substring(fileName.lastIndexOf("\\") + 1)));

response.sendRedirect(site);

}

}

%>

However the response.sendDirect(site) line is routing my application to a page displaying the output xml from my bls. I'm wondering if there is a way to call my transaction via the runner without using the response.sendDirect? I would like to upload the document and call the transaction and than direct the application back to the original screen. Any help is appreciated. Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 13, 2012 at 01:25 PM

    Hello Scott, you can achieve what to want to do with a post to an iframe located in your page.

    Then on the reply from the server, you can even put a small javascript which would call a function from the source page to let the page know that the files have been uploaded (or not).

    Cheers,

    Arnaud

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Just a small comment, it's that you are using a jsp which is able to take care of several documents but which would in fact redirect you on the first document while keeping processing and posting the documents to the Transactions, not probably the desired effect, but it should work with one document, if it is provided, if nothing is provided, nothing is returned...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.