Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Ability to upload a file using Javascript

Posted on 2003-03-04
Medium Priority
Last Modified: 2011-08-18
Hello.  I am new to BV and have run into a problem that I desperately need answered.  I need the ability to allow a user to browse for a file on the desktop to be written/uploaded to the /tmp directory on the server.  I have added the following code in my javascript to allow the user to browse:  
<form action="./uploadfile.jsp" method="POST" enctype="multipart/form-data">
<INPUT TYPE="file" NAME="userfile" SIZE="35" MAXLENGTH="255">
<INPUT TYPE="submit" VALUE="Process" NAME="ProcData">

However, when the uploadfile.jsp is invoked, the BVI_Request is empty.  There is an error in the log and the contents of the file is written to the log.  How can I capture the contents in my uploadfile.jsp javascript?  I need to write the file to the server for ftping to an appropriate dropbox area.  Here is the log entry that results when run this (note: the contents of the file is merely This is a test):
Fri Feb 21 07:33:57 2003 (1045841637.003046) bvsmgr[14979]@zerg:<18.0>:L1:S18 BVSM_
Request::split: couldn't split ----------------------------7d320320270528^M
Content-Disposition: form-data; name="userfile"; filename="D:\Profiles\Kheilige\Desktop\thisisatest.txt"^M
Content-Type: application/octet-stream^M
This is a test.^M
Content-Disposition: form-data; name="ProcData"^M
Check for precisely one '=' character

I would really appreciate any assistance you can provide.  Thanks.
Question by:kheil

Accepted Solution

adelimon earned 200 total points
ID: 8341644
I don't believe this is possible in JavaScript.  You'll need to take another route.  Depending on your version of BV there are two options:
1.  Use Java to do uploads.  This is what you probably SHOULD do.  But it only works on BV version 6.0 and up becuase you will need to write a servlet.

2.  Write a perl script on your webserver, and post to that.  This takes you outside of BV but it does work.

Author Comment

ID: 8349411
Thanks for the response.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Integration Management Part 2
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question