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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

771 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