473,413 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Problem with HTML in ASP.Net App

Hey All,

I have the following HTML:

' <form id="htmlupload" enctype="multipart/form-data" method="post"
action="C:\Inetpub\wwwroot\FileUpload\upload.pl"
' <br>
' <INPUT type="file" name="htmlupload" value="G:\Satuit CRM\HTML
Docs\Satuit IE Automation Prototype.doc">
' <br>
' <INPUT type="submit" value="Upload Default File" name="Upload via HTMl">
' </form>

And I have the following CGI script:

#!/usr/bin/perl
use CGI;
my $cgi = new CGI;
my $dir = $cgi->param('dir');
my $file = $cgi->param('file');
$file=~m/^.*(\\|\/)(.*)/; # strip the remote path and keep the filename
my $name = $2;
open(LOCAL, ">$dir/$name") or die $!;
while(<$file>) {
print LOCAL $_;
}
print $cgi->header();
print "$file has been successfully uploaded... thank you.\n";
Why won't the file upload? Why won't the default value get used?

Thanks & Regards,

TC
Jul 20 '06 #1
4 1101
Hey All,
>
I have the following HTML:

' <form id="htmlupload" enctype="multipart/form-data" method="post"
action="C:\Inetpub\wwwroot\FileUpload\upload.pl"
' <br>
' <INPUT type="file" name="htmlupload" value="G:\Satuit CRM\HTML
Docs\Satuit IE Automation Prototype.doc">
' <br>
' <INPUT type="submit" value="Upload Default File" name="Upload via HTMl">
' </form>

And I have the following CGI script:

#!/usr/bin/perl
use CGI;
my $cgi = new CGI;
my $dir = $cgi->param('dir');
my $file = $cgi->param('file');
$file=~m/^.*(\\|\/)(.*)/; # strip the remote path and keep the filename
my $name = $2;
open(LOCAL, ">$dir/$name") or die $!;
while(<$file>) {
print LOCAL $_;
}
print $cgi->header();
print "$file has been successfully uploaded... thank you.\n";

Why won't the file upload? Why won't the default value get used?

Thanks & Regards,

TC
*where* do you have that html? What does the html look like when you do
a "view source" in the browser? Note: you can't have a form within a
form.

Do you get any errors? What are they?

Is that perl-script activated? By the way: asp.net can also recieve
uploaded files (see HtmlInputFile)

The default value is ignored for security reasons.
Hans Kesting
Jul 20 '06 #2
"TCook" wrote ...
Why won't the default value get used?
If you mean the default value you've plonked into the <input type="file"...
element, that would be because you can't do this.

For security, you cant prepopulate a file/browse box with details from a
client pc.

You can get around this by using 3rd party components, some involve an
active x control.

Hope this helps.

Rob
Jul 20 '06 #3
Hey Rob,

Thanks for the info.

What / where are these 3rd party components and ActiveX controls?

Regards,

Todd

"Rob Meade" <ku***************@edaem.borwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
"TCook" wrote ...
>Why won't the default value get used?

If you mean the default value you've plonked into the <input
type="file"... element, that would be because you can't do this.

For security, you cant prepopulate a file/browse box with details from a
client pc.

You can get around this by using 3rd party components, some involve an
active x control.

Hope this helps.

Rob


Jul 20 '06 #4
"TCook" wrote ...
What / where are these 3rd party components and ActiveX controls?
Hi Todd,

We have been using SoftArtisans FileUp for a considerable amount of time now
with no problems (www.softartisans.com) - the control that we've used to
grab a file (either visibly or invisibly) from a client pc is called XFile.
It relies on the client installing the activeX obviously, but if its for use
within your organisation (like us) as opposed to a public www server it
shouldn't be a hardship.

Hope this helps.

Regards

Rob
Jul 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Federico Bari | last post by:
Good morning all from italy, i have probably a compatibility problem with a html/javascript page. The aim of the code of the file test.htm you find here following (copy the 3 files in the...
1
by: delerious | last post by:
Could someone please take a look at this page: http://home.comcast.net/~delerious1/index11.html The set of links on the left should not have any whitespace between them, and the set of links...
0
by: Lucas, Todd | last post by:
Hello everyone! I'm having a problem with a WebControl that I'm designing for a Menu. I've been at it for about 3 weeks now, and can't seem to get around this problem. So I'm hoping that someone...
7
by: Trickynick1001 | last post by:
Hi, a newbie here. I don't have a real firm grasp on the idea of Javascript, as I'm used to programming in Qbasic and C. I'm not used to OOP. Anyway, I really don't have any idea what the...
7
by: Jeffery Small | last post by:
I have a hand-crafted set of HTML files. each file begins with the line: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> while the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.