Solved

Netscape Livewire: file upload

Posted on 1997-03-12
1
189 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
[X]
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
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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBS script  to map network printers to all users. 3 65
CSV file copy field 1 to field 2 2 63
How to check if the Cron job is running or not ? 12 87
Edit my bash script 16 47
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

751 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