ASP.Net, PERL and File Uploading

G

getmyemails2

Hello All,

I have an ASP.Net application and I need to upload files from a
pre-determined source. Although a standard HTML FileInput control will
allow a default "value" property, the control available in ASP.Net does
not.

Can I pass a string representing a filename and path to a PERL script
in
order to upload a file?

If the above can work, are there other configuration settings required
to run a CGI script written in PERL from within an ASP.Net environment?

I have ActivePerl installed on my machine along with "C:\Temp" folder,
etc.

Thanks & Regards,

TC
 
M

mgarrish

Hello All,

I have an ASP.Net application and I need to upload files from a
pre-determined source. Although a standard HTML FileInput control will
allow a default "value" property, the control available in ASP.Net does
not.

Really? What browser allows a default value? Opera's the only one I've
ever heard of, but it prompts before allowing a postback if that value
hasn't been altered. If what you were asking were possible anyone could
write in the file they want to steal from the user's machine and pull
it up to the server.
Can I pass a string representing a filename and path to a PERL script
in
order to upload a file?

No, you need the user to select or type in the value and submit the
form, otherwise the browser will not send the file to the server, and
without the file the path is useless to the script on the receiving
end.
If the above can work, are there other configuration settings required
to run a CGI script written in PERL from within an ASP.Net environment?

Perl and ASP.NET have nothing to do with each other. If you chose to
configure your server during the ActivePerl install then you should be
able to run .pl and .plx files.

Matt
 
M

Mumia W.

Hello All,

I have an ASP.Net application and I need to upload files from a
pre-determined source. Although a standard HTML FileInput control will
allow a default "value" property, the control available in ASP.Net does
not.

Can I pass a string representing a filename and path to a PERL script
in order to upload a file?

Yes

If the above can work, are there other configuration settings required
to run a CGI script written in PERL from within an ASP.Net environment?

There are many. Launch a command prompt and type "perldoc CGI"
to learn about the Perl CGI module. Someone else will have to
give you the pointers on getting ActivePerl working with your
web server.

In Perl, to create a file-upload control that has a default
value, you can either write the HTML text directly, like so:

print q{
<p> Please enter your file name:
<input type=file value="myfile.val" >
</p>
};

Or you can use CGI.pm's methods for creating them. See §
"Creating a file upload field" in "perldoc CGI".
I have ActivePerl installed on my machine along with "C:\Temp" folder,
etc.

Thanks & Regards,

TC

You're welcome.
 
M

Matt Garrish

In Perl, to create a file-upload control that has a default
value, you can either write the HTML text directly, like so:

print q{
<p> Please enter your file name:
<input type=file value="myfile.val" >
</p>
};

Or you can use CGI.pm's methods for creating them. See §
"Creating a file upload field" in "perldoc CGI".

And have you ever tried doing this? Please run the following html
snippet which, unless you're using Opera, will show you you can't set a
default value:

<html>
<head>
<title></title>
</head>

<body>

<form>
<input type="file" id="thisFile" value="c:/windows/system.ini" />
</form>

<script type="text/javascript">
alert(document.getElementById("thisFile").value);
</script>

</body>
</html>
 
M

Mumia W.

Mumia said:
[...]
you can use CGI.pm's methods for creating them. See §
"Creating a file upload field" in "perldoc CGI".

And have you ever tried doing this? Please run the following html
snippet which, unless you're using Opera, will show you you can't set a
default value:
[...]

Interestingly, before I posted, I had only tested setting the
default value with lynx, and it worked, so I posted.

Also interestingly, it failed with every other browser I
tried: w3m, konqueror, epiphany, mozilla, and firefox.

There is nothing in the HTML spec that requires the the
browser to accept a default value for file upload controls,
and there are undeniably security concerns with allowing that.

So what are the chances you can get all of your users to move
to either Opera or Lynx?

:)
 
M

Matt Garrish

Mumia said:
Mumia said:
[...]
you can use CGI.pm's methods for creating them. See §
"Creating a file upload field" in "perldoc CGI".

And have you ever tried doing this? Please run the following html
snippet which, unless you're using Opera, will show you you can't set a
default value:
[...]

Interestingly, before I posted, I had only tested setting the
default value with lynx, and it worked, so I posted.

I'm surprised Lynx can even display a form... ; )

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top