Contact us


All times are UTC - 8 hours



   [ 5 posts ] 
Author Message
   


Joined: Thu Dec 15, 2011 12:45 am
Posts: 4
Hello, I have this problem.

I took your example from online demo and i managed to configure it working Internet Explorer.
In IE everything works fine, I manage to scan documents and I upload them to a servlet of mine.
The same page doesn't work on Firefox: i manage to scan pages, but when I upload the image, it calls the servlet but when my servlet tries to parse the file from the message, it gives me such error:

the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null

I may add, that while the demo online on your website show me the progress bar while uploading, my test on localhost doesn't show this progress bar.
I'm using your example with references to my webpages in order not to fail and i succeed since I managed to upload files from IE. Same error for safari on Windows but I would like to solve firefox problem first...

Win XP/SP2
Mozilla Firefox Plugin
Apache Tomcat Server/Servlet Java 2.5


   


Joined: Thu Dec 15, 2011 12:45 am
Posts: 4
Hello,

I found the solution, maybe I remembered it from the past when I worked on the plugin. So now i managed to configure it.
I forgot to submit the page after calling the function HTTPUploadAllThroughPostAsPDF

Code:
$('DynamicWebTwain1').HTTPUploadAllThroughPostAsPDF(
                   strHTTPServer,
                   strActionPage,
                   document.all.txt_fileName.value + ".pdf");
         
      
      if(   CheckErrorString() || isIEGlobalVar)
         {                                   
          if(window.opener)
                 window.opener.location.reload();
            setTimeout(function(){
               window.close();
               },700); 
         }else{
         frmScan.action = "SaveToDb?cod=... <omitted> ";
         frmScan.submit();
         }


Depending on the browser I execute the submit or not. With IE there is no need to submit the page after, with Firefox, Safari, Opera there is such a need.
I don't like the two times post, but I found only this solution.

Federico


User avatar
   


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1706
Hi FedericoB,

Good to know you've found a solution by yourself. :)

FedericoB wrote:
 
Code:
frmScan.action = "SaveToDb?cod=... <omitted> ";
         frmScan.submit();
         }


Depending on the browser I execute the submit or not. With IE there is no need to submit the page after, with Firefox, Safari, Opera there is such a need.
I don't like the two times post, but I found only this solution.

Seems to me there are some extra fields that need to be submitted. Perhaps you can try the method SetHTTPFormField. This method binds text parameters to be sent to the server together with the upload. You can use it like:
Code:
$('DynamicWebTwain1').SetHTTPFormFiel("cod", "thevalue");
$('DynamicWebTwain1').SetHTTPFormFiel("otherparas", "theirvalues");
...

This method should be used before the upload (only 1 post). And as you can see, you can use the method many times if more than 1 field need to be sent.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


   


Joined: Thu Dec 15, 2011 12:45 am
Posts: 4
The problem is that when i use

Code:
$('DynamicWebTwain1').HTTPUploadAllThroughPostAsPDF(
                   strHTTPServer,
                   strActionPage,
                   document.all.txt_fileName.value + ".pdf");


I correctly see the submitted parameters from the servlet (i wrote them as a query string of the action page), but i don't see the content multipart/form-data and binary file stream.
Maybe the right solution is to use only form.submit() with Plugin.SetHTTPFormFiel("cod", "thevalue"); for firefox & others

and


Code:
$('DynamicWebTwain1').HTTPUploadAllThroughPostAsPDF(
                   strHTTPServer,
                   strActionPage,
                   document.all.txt_fileName.value + ".pdf");


for IE.
Thank you for your answer,

Federico


User avatar
   


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1706
:D

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Display posts from previous:  Sort by  
   [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Copyright © 2018 Dynamsoft | All Rights Reserved
dynamic designed by Dynamsoft team