Hello again,
Thanks for answering my previous questions.
I am still using the unregistered version of JBatchUpload to make it work with our system. I am at the final stage and we have one more issue.
I am using the JSPUpload's process.jsp code and I created two directories:
<% String directory = "C:/UploadedFiles/jfileupload"; %>
<% String tmpdirectory = "C:/UploadedFiles/jfileupload/tmp"; %>
To set temporary files in the tmp folder, I write
upBean.setParsertmpdir(tmpdirectory + account);
Now my task is that I need to calculate the checksum of
1) the file which is being uploaded [this is accessed from the request ]
2) the file which lies in the tmp folder [ the filename.tmp file which is created in tmp folder]
Then I am suppose to compare both of them to see if the file which is being uploaded and the file which lies in the tmp folder has the same checksum.
Is it really possible to do something like this? Could you please provide me with some suggestion?
Accessing checksum of files in tmp folderRe: Accessing checksum of files in tmp folderWell, yes. And this feature is almost available in process.jsp and in JFileUpload.
Did you try: <PARAM NAME="resume" VALUE="md5"> process.jsp will compute MD5 and send it back to applet before resuming. Re: Accessing checksum of files in tmp folderHello again,
My javascript code looks like below: Code: Select all
Code: Select all
Re: Accessing checksum of files in tmp folderThere are 2 requests issued by applet for resume:
- HTTP HEAD with 'resume' header which contains "md5" or "crc" The JSP must return the MD5 computed for file on server-side - HTTP POST for upload without 'resume' header. But I understand that you want the applet to compute MD5 and send it in the upload request, correct? So you don't need resume parameter but checksum parameter as you did: <PARAM NAME="checksum" VALUE="md5"> then in you JSP: request.getHeader("checksum") will return the MD5 value such as 3fefd95937071577d6fb7e5e2c8205f6 Does it work for you? Re: Accessing checksum of files in tmp folderHello again,
Yes this was what I was doing it. So it seems to be the right procedure. I had one more question, I need to forward this checksum to current / another page. So I define document.writeln('<PARAM NAME="post" VALUE="http://localhost:8080/jfileupload/success.jsp">'); document.writeln('<PARAM NAME="postparameters" VALUE="extra">'); What I understand, by saying postparameters is extra, I can get the extra parameters. In the success.jsp page, i can see logger.info("file "+request.getParameter("filename1")); which returns me the file name. I was wondering if I can get the checksum also. [Since I define postparameter as extra] As you can see, I have already defined checksum in my javascript file. Thanks for your prompt support. Re: Accessing checksum of files in tmp folderNo, checkum is not passed in "post" or "forward" parameters. If you need this feature then we can implement this feature. Contact support(at)jfileupload(dot)com
|