Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Netscape Livewire: file upload

Posted on 1997-03-12
1
Medium Priority
?
197 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 100 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Suggested Courses

782 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