Date: Thu, 05 Jul 2001 13:27:22 -0500 From: "The Crystal Ball Inc." Subject: how do you move a created file Message-Id: <3B44B18A.F0EED45@wehug.com> Hello all, Need some help, I'm getting 403 errors and must resolve. I'm using a cgi/perl script that creates a file called mega.htm and puts that file in my cgi-bin area. When I try to look at that file by typing the url in my browser, it gives me a 403 permissions error. The file is given 666 level permissions by the script, which seems adequate but still returns a 403 error. My problem is that the file called mega.htm must be accessed and read by a spider from an outside website. There is a peculiar thing , I do not see the directory named megalist but I do see the file mega.htm in my cgi-bin area. I can physically download and then upload this file to my public html area and then can look at it with my browser. So what is the best way to fix this, create another few lines of perl code that can move this file to my public html area ? Apparently there is a block in the cgi-bin area that wont allow a browser see files located there by a browser. here is the sub that creates the file: ################################### ### Sub: BidFind List ### Prints out a very "basic" HTML page for BidFind to use to ### index your web site auction contents. sub megalist { umask(000); # UNIX file permission junk mkdir("$config{'megalist'}", 0777) unless (-d "$config{'megalist'}"); open (MEGAFILE, ">$config{'megalist'}/mega.htm"); print MEGAFILE "\n\nBidFind MegaList at $config{'sitename'}\n\n\n"; close (MEGAFILE); my $key; foreach $key (sort keys %category) { opendir (THEDIR, "$config{'basepath'}$key") || &oops("Category directory $key could not be opened."); readdir THEDIR; readdir THEDIR; my @allfiles = sort { $a <=> $b } readdir THEDIR; closedir THEDIR; my $file; foreach $file (sort { int($a) <=> int($b) } @allfiles) { if (-T "$config{'basepath'}$key/$file") { $file =~ s/^$config{'basepath'}$key\///; $file =~ s/\.dat$//; open THEFILE, "$config{'basepath'}$key/$file"; my ($title, $reserve, $inc, $desc, $image, @bids) = &read_item_file($key,$file); close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bids[$#bids]); my ($selleralias, $selleremail, $sellerbid, $sellertime, $selleradd1, $selleradd2, $selleradd3) = &read_bid($bids[0]); my @closetime = localtime($file); $closetime[4]++; open (MEGAFILE, ">>$config{'megalist'}/mega.htm"); print MEGAFILE "$title $bid$category{$key}$closetime[4]/$closetime[3]
\n"; close (MEGAFILE); } } } open (MEGAFILE, ">>$config{'megalist'}/mega.htm"); print MEGAFILE "\n\n"; close (MEGAFILE); } the sub is called or executed by this &megalist; which is placed in another sub that creates a listing for something else. here is the variable: $config{'megalist'} = '/usr/www/users/nuspirit/cgi-bin/'; there is an earlier line: local %config; also here is some stuff fron the top of the script: #!/usr/bin/perl use vars qw(%config %category %form); require "postal.pl"; #this calls a script that has to do with email and works fine. use strict; ##################### Anyway there it is, would appreciate any suggestions and thanks in advance. I'm not a cgi or perl programmer, just trying to muddle my way through, I didn't write this sub or the main script. The script and the addon sub are for an auction program called everysoft auction. I tried to get some help from the EA auction forum, but it seems that no one is willing to reply. Mike mike@wehug.com