server side example for JBatchUpload

Enhanced frontend add-on to queue files.
Post Reply
Indu
Posts: 19
Joined: Tue Mar 10, 2009 6:09 pm

server side example for JBatchUpload

Post by Indu »

Do you have any server side example for JBatchUpload for classsic Asp??

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: server side example for JBatchUpload

Post by support »

No, only ASP.NET but for ASP you could adapt regular ASP upload:
http://www.asp101.com/articles/jacob/scriptupload.asp

The applet use "uploadfile" as name for <INPUT FILE="">

Indu
Posts: 19
Joined: Tue Mar 10, 2009 6:09 pm

Re: server side example for JBatchUpload

Post by Indu »

So I won't be able to use JBatchUpload on Classic Asp?? I can only use JfileUpload?? I am kind of new to this and doing some research to buy..So If you can sent me a good example for JBatchUpload either in .net or asp will be greatly appreciated..

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: server side example for JBatchUpload

Post by support »

The ASP script will work with both JBatchUpload and JFileUpload because they send exactly the same HTTP requests. Let me see if I can provide a working sample today. Stay online ...

Indu
Posts: 19
Joined: Tue Mar 10, 2009 6:09 pm

Re: server side example for JBatchUpload

Post by Indu »

THankyou so much..I will wait for that..

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: server side example for JBatchUpload

Post by support »

Ok, I've packaged an ASP sample for JFileUpload. You can download it at:
http://www.jfileupload.com/products/too ... .0beta.zip

It supports only basic upload (i.e. multiple files upload). It doesn't support resume, folders creations on server, chunks ... Also, it is slow for large uploads because of missing optimization in ASP script. However, it allows you to test basic features of JFileUpload (and others add-ons such as JBatchUpload) with a working ASP script.

Here are instructions to make it works:
1 - Download the script and unzip in your IIS server:
http://www.jfileupload.com/products/too ... .0beta.zip

2 - Update process.asp to replace c:\uploads by your own server-side upload folder.

3 - Optionally increase your ASP upload size limit in your IIS server through AspMaxRequestEntityAllowed property in your MetaBase.xml file (see the readme.txt).

4 - Open uploadform.html to test basic upload from HTML form. If it works then you can go to next step.

5 - Download JFileUpload and install it in the same folder as ASP script.
http://www.jfileupload.com/products/jfi ... index.html

6 - Update "url" parameters in applet_http_asp.js to match your server such as:
<PARAM NAME="url" VALUE="http://yourserver.com/something/process.asp">

7 - Open applet_http_asp.html in your browser, the applet will load, select a file and see if it is uploaded.

8 - If step 7 is ok then download JBatchUpload and install it in the same folder again.
http://www.jfileupload.com/products/jba ... index.html

9 - Update "url" parameter again in applet_http_batchupload.js and open applet_http_batchupload.html in your browser. If the applet doesn't load then setup ".properties" to "text/plain" in IIS mime-types settings.

Does it help ?

You should be able to upload files with JBatchUpload with the ASP script.

Indu
Posts: 19
Joined: Tue Mar 10, 2009 6:09 pm

Re: server side example for JBatchUpload

Post by Indu »

Appreciate your help..I will try it out

Indu
Posts: 19
Joined: Tue Mar 10, 2009 6:09 pm

Re: server side example for JBatchUpload

Post by Indu »

The example you gave works fine..Thanks a lot..Now I am doing some customization..
I wanted to do some checks on process.asp before uploading..For that I thought will pass some variables param1-12 and values in the applet.. How do I access the variables and values in process.asp?? Appreciate your help


document.writeln(' classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="590" HEIGHT="590" NAME="fileupload" codebase="http://java.sun.com/update/1.4.2/jinsta ... on=1,4,0,0">');
document.writeln('<PARAM NAME=CODE VALUE="jfileupload.upload.client.MApplet.class">');
document.writeln('<PARAM NAME=CODEBASE VALUE="./">');
document.writeln('<PARAM NAME=ARCHIVE VALUE="jfileupload.jar,httpimpl.jar,chttpclient.jar,clogging.jar,batchui.jar">');
document.writeln('<PARAM NAME=NAME VALUE="fileupload">');
document.writeln('<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">');
document.writeln('<PARAM NAME="scriptable" VALUE="true">');
document.writeln('<PARAM NAME="url" VALUE="' + PropUrl2 + '">');
document.writeln('<PARAM NAME="paramfile" VALUE="uploadfile">');
document.writeln('<PARAM NAME="param1" VALUE="todo">');
document.writeln('<PARAM NAME="value1" VALUE="upload">');
document.writeln('<PARAM NAME="transferui" VALUE="jfileupload.transfer.client.edesign.BatchTransferUI">');
document.writeln('<PARAM NAME="transferuiresources" VALUE="i18n_pane">');
document.writeln('<PARAM NAME="resources" VALUE="i18n_bar">');
document.writeln('<PARAM NAME="mode" VALUE="http">');
document.writeln('<PARAM NAME="param2" VALUE="cType">');
document.writeln('<PARAM NAME="param3" VALUE="uploadServer">');
document.writeln('<PARAM NAME="param4" VALUE="ids">');
document.writeln('<PARAM NAME="param5" VALUE="name">');
document.writeln('<PARAM NAME="param6" VALUE="AllowUpload">');
document.writeln('<PARAM NAME="param7" VALUE="usercompany">');
document.writeln('<PARAM NAME="param8" VALUE="AccessGroup">');
document.writeln('<PARAM NAME="param9" VALUE="subfolder">');
document.writeln('<PARAM NAME="param10" VALUE="FileField">');
document.writeln('<PARAM NAME="param11" VALUE="TemplateType">');
document.writeln('<PARAM NAME="param12" VALUE="ProjectTemplate">');
document.writeln('<PARAM NAME="value2" VALUE="' + cType + '">');
document.writeln('<PARAM NAME="value3" VALUE="' + uploadServer + '">');
document.writeln('<PARAM NAME="value4" VALUE="' + ids + '">');
document.writeln('<PARAM NAME="value5" VALUE="' + name + '">');
document.writeln('<PARAM NAME="value6" VALUE="' + AllowUpload + '">');
document.writeln('<PARAM NAME="value7" VALUE="' + usercompany + '">');
document.writeln('<PARAM NAME="value8" VALUE="' + AccessGroup + '">');
document.writeln('<PARAM NAME="value9" VALUE="' + subfolder + '">');
document.writeln('<PARAM NAME="value10" VALUE="' + FileField + '">');
document.writeln('<PARAM NAME="value11" VALUE="' + TemplateType + '">');
document.writeln('<PARAM NAME="value12" VALUE="' + ProjectTemplate + '">');

Indu
Posts: 19
Joined: Tue Mar 10, 2009 6:09 pm

Re: server side example for JBatchUpload

Post by Indu »

Soory I got it..I used the forword url for the purpose..

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: server side example for JBatchUpload

Post by support »

Ok, anyway the answer to your question if you need to get parameter from the multipart request:
Uploader.Form("yourparam")

For instance, the HTML form has a todo=upload parameter:
Response.Write "todo:" & Uploader.Form("todo") & "<br>"

Also, I've improved the ASP sample to speed up upload processing ASP, the updated script is available at: http://www.jfileupload.com/products/too ... 0beta2.zip

Post Reply