Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem with HTML in ASP.Net App

Reply
Thread Tools

Problem with HTML in ASP.Net App

 
 
TCook
Guest
Posts: n/a
 
      07-20-2006
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


 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      07-20-2006
> 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


 
Reply With Quote
 
 
 
 
Rob Meade
Guest
Posts: n/a
 
      07-20-2006
"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


 
Reply With Quote
 
TCook
Guest
Posts: n/a
 
      07-20-2006
Hey Rob,

Thanks for the info.

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

Regards,

Todd



"Rob Meade" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> "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
>
>



 
Reply With Quote
 
Rob Meade
Guest
Posts: n/a
 
      07-21-2006
"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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the easiest way to convert a .net windows app to web app? tom ASP .Net 4 10-24-2008 05:57 PM
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
Problem with Assembly.LoadFrom with web app, not unit test console type app. pkellner ASP .Net 0 04-27-2007 03:34 PM
Tkinter app=App(root) problem snoylr@gmail.com Python 1 04-30-2005 03:11 PM
Asp.net app, Unable to load dll!!, while same dll loads properly in Win form app NGM ASP .Net 0 11-06-2003 10:34 AM



Advertisments