Solved

Netscape Livewire: file upload

Posted on 1997-03-12
1
185 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

785 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