Re: filefield...Solution number 7: UPDATE

2007-04-12 Thread Bill Luebkert
Jerry Kassebaum wrote:
> I wrote back to the guys at my server, asking what they did to solve the 
> problem. The actual solution was that they added this line, right under the 
> shebang line:
> 
> $CGITempFile::TMPDIRECTORY = '/users/web/kass/web/dns/tmp';

You could also have just done a mkdir './tmp' if ./tmp doesn't exist
(you're probably sitting in your cgi-bin dir) and used 'tmp' or './tmp'
for your tmp dir and then set $ENV{TMPDIR} to wherever that is.

 From CGI.pm docs:

To ensure that the temporary file cannot be read by other CGI scripts,
use suEXEC or a CGI wrapper program to run your script.  The temporary
file is created with mode 0600 (neither world nor group readable).

The temporary directory is selected using the following algorithm:

 1. if the current user (e.g. "nobody") has a directory named
 "tmp" in its home directory, use that (Unix systems only).

 2. if the environment variable TMPDIR exists, use the location
 indicated.

 3. Otherwise try the locations /usr/tmp, /var/tmp, C:\temp,
 /tmp, /temp, ::Temporary Items, and \WWW_ROOT.

Each of these locations is checked that it is a directory and is
writable.  If not, the algorithm tries the next choice.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: filefield...Solution number 7: UPDATE

2007-04-12 Thread Jerry Kassebaum
I wrote back to the guys at my server, asking what they did to solve the 
problem. The actual solution was that they added this line, right under the 
shebang line:

$CGITempFile::TMPDIRECTORY = '/users/web/kass/web/dns/tmp';

_
Mortgage refinance is Hot. *Terms. Get a 5.375%* fix rate. Check savings 
https://www2.nextag.com/goto.jsp?product=10035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2bbb&disc=y&vers=925&s=4056&p=5117

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: filefield...Solution number 7

2007-04-12 Thread Jerry Kassebaum

>Things to look at or try:

7)  This is from a rep at my server:


"Hi Jerry,

Thank you for contacting us.

We have found the problem and we have fixed it for you. Kindly check it.

Thank you."



Thanks for your help, Bill!! It is working. If you upload a textfile to 
http://biblescramble.com/dns/textAreaLuebkert.cgi its contents will be 
printed out on the next page.

_
Need a break? Find your escape route with Live Search Maps. 
http://maps.live.com/?icid=hmtag3

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: filefield

2007-04-12 Thread Bill Luebkert
Jerry Kassebaum wrote:
> 
> I tried
> 
> my $tmpdir = "/tmp";
> 
> and
> 
> my $tmpdir = $ENV{TEMP} || "C:/tmp";
> 
> and
> 
> my $tmpdir = $ENV{TEMP} || "/tmp";
> 
> Same error: "Software error:
> 
> CGI open of tmpfile: Permission denied"

Things to look at or try:

1) What are the perms on /tmp ?

2) What user are you running as ?

3) Could you create a tmp dir under wherever you are running
and give it 0600 or 0644 perms and try using 'tmp' then
instead of '/tmp'.

4) If you have shell access, see if you can create a file in
/tmp and/or this new dir ./tmp .

5) What webserver are you using ?

6) Continue on in this vein until you figure out why you're
being denied permission to create the temp file.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: filefield

2007-04-11 Thread Jerry Kassebaum
>Jerry Kassebaum wrote:
>>Bill et. al.,
>>
>>This is a little embarrasing. Bill, you helped me with a similar problem 
>>back in December, but I never quite got it. Below is the code you gave me. 
>>But when I browse to a file and submit, I get the error: "Software error: 
>>CGI open of tmpfile: Permission denied".
>>
>>About 10 lines down is the line 'my $tmpdir = $ENV{TEMP} || "C:/temp";"' 
>>Can the C:/temp" part be the problem? I upload the cgi file to my linux 
>>server.
>>
>>Or do I need to get the people at my server to set permissions somehow?
>>
>>The code below is at http://biblescramble.com/dns/textAreaLuebkert.cgi.
>>
>># place to store files - change me if you like
>>
>>my $tmpdir = $ENV{TEMP} || "C:/temp";
>
>You probably want /tmp on UNIX's.  C:/temp is for Windoze.

I tried

my $tmpdir = "/tmp";

and

my $tmpdir = $ENV{TEMP} || "C:/tmp";

and

my $tmpdir = $ENV{TEMP} || "/tmp";

Same error: "Software error:

CGI open of tmpfile: Permission denied"

_
Interest Rates Fall Again! $430,000 Mortgage for $1,399/mo - Calculate new 
payment 
http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-18679&moid=7581

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: filefield

2007-04-11 Thread Bill Luebkert
Jerry Kassebaum wrote:
> Bill et. al.,
> 
> This is a little embarrasing. Bill, you helped me with a similar problem 
> back in December, but I never quite got it. Below is the code you gave me. 
> But when I browse to a file and submit, I get the error: "Software error: 
> CGI open of tmpfile: Permission denied".
> 
> About 10 lines down is the line 'my $tmpdir = $ENV{TEMP} || "C:/temp";"' Can 
> the C:/temp" part be the problem? I upload the cgi file to my linux server.
> 
> Or do I need to get the people at my server to set permissions somehow?
> 
> The code below is at http://biblescramble.com/dns/textAreaLuebkert.cgi.
>
> # place to store files - change me if you like
> 
> my $tmpdir = $ENV{TEMP} || "C:/temp";

You probably want /tmp on UNIX's.  C:/temp is for Windoze.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: filefield

2007-04-11 Thread Jerry Kassebaum
Bill et. al.,

This is a little embarrasing. Bill, you helped me with a similar problem 
back in December, but I never quite got it. Below is the code you gave me. 
But when I browse to a file and submit, I get the error: "Software error: 
CGI open of tmpfile: Permission denied".

About 10 lines down is the line 'my $tmpdir = $ENV{TEMP} || "C:/temp";"' Can 
the C:/temp" part be the problem? I upload the cgi file to my linux server.

Or do I need to get the people at my server to set permissions somehow?

The code below is at http://biblescramble.com/dns/textAreaLuebkert.cgi.

###

#!/usr//bin/perl -T

use strict;
use warnings;
use CGI qw/:standard/;
use CGI::Carp qw(carpout fatalsToBrowser);

# place to store files - change me if you like

my $tmpdir = $ENV{TEMP} || "C:/temp";

print header;
print start_html;

if (param ('textAreadomains'))  {

print h1 'Hi - got your domains:',
p (
  param ('textAreadomains'),
),
}

elsif (param ('fileDomains')) {

my $filename = param ('fileDomains');
my $tmppath = "$tmpdir/$filename";
my $text;

my $size = 0;
while (my $bytes = read $filename, my $buffer, 4096) {
$text .= $buffer;
$size += $bytes;
}
close OUT;
close $filename;

print h1 'Hi - got your file:',
p (
  param ('fileDomains'),
),
p ("Content: ", textarea (-name, 'textAreadomains', -rows, "15",
  -cols, "75", -default => $text),
),
}

else {

print h1 ('Hi - pick one to input'),
start_form,
p ("Enter domain names, one per line: ", textarea (-name,
  'textAreadomains', -rows, "15", -cols, "75"),
),
submit,
end_form,
hr,

start_multipart_form,
p ("Or upload a text file: ",
  filefield (-name, 'fileDomains'),
),
submit,
end_multipart_form,
hr;
}

print end_html;

__END__

_
Mortgage rates near historic lows. Refinance $200,000 loan for as low as 
$771/month* 
https://www2.nextag.com/goto.jsp?product=10035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h27f8&disc=y&vers=689&s=4056&p=5117

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: filefield

2007-04-11 Thread Bill Luebkert
Jerry Kassebaum wrote:
> Friends,
> 
> I'm hoping I'm missing something obvious.
> 
> I have a cgi page with checkboxes, radio buttons, textareas working. 
> However, I'm trying to add a filefield and having trouble.
> 
> I have a print statement, followed by a few lines ending in commas.
> 
> Later I have:
> start_multipart_form(-method, "post", -action, "famParam.cgi"),
> 
> Still later I have:
> filefield('photo','x',40,8000),

What's with the 8000 ?  Try 260 or less.

> etc.
> 
> That page works fine. However the receiving page displays an "Internal 
> Server Error" if I so much as mention a file on the filefield "browse" line 
> on the first page.
> 
> The first page seems to work fine. The second page has the error. Both pages 
> work fine if the filefield line is left blank.
> 
> I'm hoping that's enough clues.

A proper way to get help on something like this is to create the smallest
test script that you can that reproduces the problem and post it.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


filefield

2007-04-11 Thread Jerry Kassebaum
Friends,

I'm hoping I'm missing something obvious.

I have a cgi page with checkboxes, radio buttons, textareas working. 
However, I'm trying to add a filefield and having trouble.

I have a print statement, followed by a few lines ending in commas.

Later I have:
start_multipart_form(-method, "post", -action, "famParam.cgi"),

Still later I have:
filefield('photo','x',40,8000),

etc.

That page works fine. However the receiving page displays an "Internal 
Server Error" if I so much as mention a file on the filefield "browse" line 
on the first page.

The first page seems to work fine. The second page has the error. Both pages 
work fine if the filefield line is left blank.

I'm hoping that's enough clues.

Jerry

_
Need a break? Find your escape route with Live Search Maps. 
http://maps.live.com/?icid=hmtag3

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs