Solved

Netscape Livewire: file upload

Posted on 1997-03-12
1
184 Views
Last Modified: 2013-12-25
I am developing an application where the user will upload an image file from the browser. The image is to be stored into a database.
The configuration is
browser - netscape navigator 4.0 (beta)
web server - netscape enterprise 2.0 on NT 4.0
database - informix online for workgroups ver 7.12
db connectivity tool - netscape livewire pro 1.x

I have a form with ENCTYPE="multipart/form-data" which has a few text fields and a TYPE=file field.

My problem is that the LiveWire request object submitted by the form with is received as a null object by the server side javascript.

When I debug the application, the debug window shows the data entered by the user in the form, but it cannot be accessed by the standard mechanism i.e.
request.fieldname
syntax.

Everything seems to work fine when the ENCTYPE tag is removed, but I do need it for file upload to work. Without ENCTYPE, only the file name is sent to the server and not the file contents.

All suggestions/solutions are welcome.

Thanks in advance.

Aniruddha
0
Comment
Question by:ajoshi
1 Comment
 
LVL 1

Accepted Solution

by:
Kallisti earned 50 total points
ID: 1827496
The ENCTYPE should be multipart/form-data.  Otherwise,
as you say, it will simply send the filename info..

Anyway, although I am not too good on java, the above
enctype will come in on stdin (cin?  tiz on c++ anyway!)
as a mime section (not a correct mime message as it
does not have the right headers..

In perl, and html, here is an example that will save
the file locally:

--html page --

<HTML><BODY>

<FORM ACTION="antest.cgi" ENCTYPE="multipart/form-data">

<INPUT TYPE="file" name=afile><BR>
<INPUT TYPE="submit">

</FORM>

</BODY></HTML>
--  end --

-- perl script --

#!/usr/bin/perl

print "Content-Type: text/html\n\n";
print "<H1>This part is the html outputted to screen</H1>\n";

$line = 0;

read(STDIN, $incoming, $ENV{'CONTENT_LENGTH'});

open (OUTPUT, ">recieved.file") ||
    print "<P> ERROR in opening output file";

print OUTPUT $incoming;

close (OUTPUT);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to count occurrences of each item in an array.

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now