Solved

Netscape Livewire: file upload

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
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…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

15 Experts available now in Live!

Get 1:1 Help Now