Gossamer Forum
Home : Products : DBMan : Customization :

Upload Mod

(Page 2 of 3)
> > > >
Quote Reply
Re: Upload Mod In reply to
JP
Thanks for the tip! But the database works just fine! And has all along.

Anyway, I will be making the changes right now. If it helps with the uploads I will let you know.

Greg
Quote Reply
Re: Upload Mod In reply to
I see that you did make the changes in the paths, but there's still a problem.

Code:
$db_script_url = "D:/InetPub/wwwroot/heritageantiquemaps/auction/orders/database/db.pl";

needs to be

Code:
$db_script_url = $db_dir_url . "/db.pl";

I really hesitate to work on the upload thing until your database is working properly without it.

------------------
JPD





Quote Reply
Re: Upload Mod In reply to
JP

I have changed the default.cfg to reflect this change that you mentioned.

$db_script_url = $db_dir_url . "/db.pl";
you can find it at
http://207.96.11.60/jpdeni/default.txt

and I have set the
$auth_user_field = -1;

and I have changed the fields to look like:
Condition => 'excellent,fine,wonderful,good,average,fair,poor,'

and I changed all of the other fields in a similar mannor.

The database still works just fine.
Quote Reply
Re: Upload Mod In reply to
Sorry...Posted in error. You did change the directory path. I think what would help us to help you is the exact error messages you receive in your web browser as well as the Perl Error Log. Please post the Errors you receive.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 02, 1999).]
Quote Reply
Re: Upload Mod In reply to
I have a feeling that you would have found problems later on, especially with the Userid field and the select fields.

I'm still trying to find out what the correct path is for your files.

Go into html.pl sub html_record and change

Code:
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
GRAPHIC: foreach $extension (@extensions) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}
}

to

Code:
if (-e "the/full/path/to/your/upload/directory/$rec{$db_key}.jpg") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$jpg>|;
}

(I just checked to be sure that there was a 1.jpg in the $SAVE_DIRECTORY_URL -- and there was!! Smile At least I know that's okay.)

For debugging purposes, right now, I think it would be best to hardcode the full path.

I just noticed in your html.pl file, you have

Code:
<div align="left">
<table border="1" align="left">
<tr>
<td width="100%"><img border="0" <img src="$rec{'Image'}"></td>
</tr>
</table>
</div>

If you would like to include a field for the URL for an image instead of using the automatic displaying of images that comes with the file upload mod, you can certainly do that. But then we'll have to change some of the other code.

What do you want to do?


------------------
JPD







[This message has been edited by JPDeni (edited September 02, 1999).]
Quote Reply
Re: Upload Mod In reply to
Hello again!

I will try to explain the errors that I am getting as clearly as possible.

The script works just fine when I use it to do anything EXCEPT upload files.

So, I this is what happens. I try to upload "1.gif" using the mod that jp gave me, and I get this error.
---------------------------------------------
CGI ERROR
==========================================

Error Message : The directory you specified isn't really a directory.
Make sure that this is indeed a directory and not a file.
---------------------------------------------


Quote Reply
Re: Upload Mod In reply to
We're throwing a lot of stuff at you at once, Greg. I hope we're not confusing you.

One other thing I noticed, though, in your html.pl file is that, in html_record_form, you have

Code:
<INPUT TYPE="Hidden" NAME="Cart" VALUE="<font color=Yellow>.</font color>" SIZE="0" MAXLENGTH="0">

This will probably cause you problems. It should be

Code:
<INPUT TYPE="Hidden" NAME="Cart" VALUE="$rec{'Cart'}">



------------------
JPD





Quote Reply
Re: Upload Mod In reply to
I meant to say "1.jpg" not "1.gif" in my last post, if it makes any difference.
Quote Reply
Re: Upload Mod In reply to
I think that I am keeping up, and I can't say it enough THANK YOU to both of you!!!!!!!!!!!!!!!!!

<INPUT TYPE="Hidden" NAME="Cart" VALUE="<font color=Yellow>.</font color>" SIZE="0" MAXLENGTH="0">

The above "thing" that you found in my html.pl file is something silly that I put in there to hold a place for a field that I may have to add a later on. I know it was not the smartest thing, but it worked at the time.

If it is not causing any problems, I am going to leave it in for now.

Quote Reply
Re: Upload Mod In reply to
AHHHHHHHHHHHHHHHHHHH I GOT A PICTURE!!!!!!!!!!!!

Quote Reply
Re: Upload Mod In reply to
The picture is the not the one that I have been uploading, it is the "1.jpg" that you made me upload using FTP.

It is also not comming from the right directory, it is the one that I put in the database directory and not the one from the userupload directory.

Greg
Quote Reply
Re: Upload Mod In reply to
Ok,

This is where we are at now. When I use the script, with-out the upload part, it works just fine with all of the changes that you have told me to do. I have placed a copy of the default.cfg and html.pl file at:

http://207.96.11.60/default.txt
http://207.96.11.60/html.txt

The script still out-puts this error,

CGI ERROR
==========================================

Error Message : The directory you specified isn't really a directory.
Make sure that this is indeed a directory and not a file.
---------------------------------------------

when I try to upload a file. However, the file IS uploaded, but it get's the following name "CGItemp1830001" without any extension on it.
The file is uploaded to the ../Database Directory instead of the
../Database/userupload directory that it should be going to.

Also, when I "list all" I see a picture associated with the first listing. The pictue is 1.jpg, and it is the file that Carol had me upload earlier. I put it into the ../Database/userupload and the ../Database directory.

If you have any other thoughts, I am all ears!

Greg

Quote Reply
Re: Upload Mod In reply to
I see you're working on it, because I keep trying to access the database and getting different error messages. I think you need to put the file paths back to what they were a little bit ago when it was working. At this point, the only file path you should be worrying about is the one to the upload directory.

Once you get things going again, I need you to take out
Code:
<div align="left">
<table border="1" align="left">
<tr>
<td width="100%"><img border="0" <img src="$rec{'Image'}"></td>
</tr>
</table>
</div>

from your html.pl file. With that in there, I'm not certain whether the file is being loaded from the file-upload mod or the Image field.

Quote:
Also, when I "list all" I see a picture associated with the first listing. The pictue is 1.jpg, and it is the file that Carol had me upload earlier. I put it into the ../Database/userupload and the ../Database directory.

I need for you to just put the graphic file in the directory where you want your uploaded files to go. I'm still trying to narrow down the correct path to that directory.





------------------
JPD





Quote Reply
Re: Upload Mod In reply to
I am not entirely sure what is happening now, but it seems to be working.... well... kind of...

it uploads a file, but if it is a *.gif then it looks like goop, and if it is a *.jpg, then it appears with an "x"

Quote Reply
Re: Upload Mod In reply to
Do you have CGI.pm installed on your server?
The problem could be with a corrupted install of CGI.pm, which is not effectively interpreting your uploaded images into their appropriate file name and extension.

That is the only other problem I can think of...

(Sorry for the confusion....Just trying to lend a helping hand.)

Smile

Carol?

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Upload Mod In reply to
Just so you know, I have again updated all of the files for you to look at:


http://207.96.11.60/jpdeni/default.txt
http://207.96.11.60/jpdeni/db.txt
http://207.96.11.60/jpdeni/file-upload.txt
http://207.96.11.60/jpdeni/htmp.txt


Greg
Quote Reply
Re: Upload Mod In reply to
If your ISP is unwilling or unable to replace their CGI.pm (and other related modules), let me know and I can send you the CGI.pm module. It is the most recent build from late June off the ActiveState site.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 02, 1999).]
Quote Reply
Re: Upload Mod In reply to
Jp,
I have everything working just fine except that the files that I upload become scrambled. See for yourself, I have uploaded "1.gif" using the mod and "2.jpg" using CuteFtp.

http://www.heritageantiquemaps.com/auction/orders/database/db.pl?db=default&uid=admin.9363025768136&view_records=1&ID=*

Both of the files show up, but 1.gif is scrambled. It is in the right place, and it appears to be the beginning of the correct file, but it is messed up for some reason. Elliot thinks that it is the CGI.pm, so I have emailed my provider and I am having them check into it.

If you have any thoughts, let me know.

Greg
Quote Reply
Re: Upload Mod In reply to
There may be some problem with using the $extension variable. Try this.

Instead of

Code:
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
GRAPHIC: foreach $extension (@extensions) {
if (-e "D:/InetPub/wwwroot/heritageantiquemaps/auction/orders/database/userupload/$rec{$db_key}.$extension") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}
}

Try

Code:
if (-e "D:/InetPub/wwwroot/heritageantiquemaps/auction/orders/database/userupload/$rec{$db_key}.jpg") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.jpg">|;
}
elsif (-e "D:/InetPub/wwwroot/heritageantiquemaps/auction/orders/database/userupload/$rec{$db_key}.gif") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.gif">|;
}


------------------
JPD





Quote Reply
Re: Upload Mod In reply to
JP
I have the above edit, installed and running. But there is no change in the way the script acts. It uploads the file, and then goes to the "upload success" page, and then,when it shows the file, the image appears broken.

greg
Quote Reply
Re: Upload Mod In reply to
Greg,

If it is not the CGI.pm module, then the only other thing I can think of is the permissions you've set for the userupload directory.

What permissions do you have for the userupload directory?

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Upload Mod In reply to
Greg, the code I gave you last is not for uploading. This is just to display the graphic files that you upload by FTP. Until we know that your CGI.pm script is working correctly, don't try uploading any more files through your browser. You'll only corrupt the files you already have there.

Upload your graphics through FTP and change the names of your graphics to match the key value of the corresponding record.

This is a fix for the time being until we can figure out what's going on with the CGI.pm module.

Also, if you want to keep testing the uploading through the web, use the other file-upload script -- the one you picked up about 20 messages ago. Smile And *don't* upload into the same directory where you already have graphic files until you are certain that it works correctly.


------------------
JPD





Quote Reply
Re: Upload Mod In reply to
I will let both of you know as soon as Erols get's back to me about the cgi.pm, untill then, I will just bide my time.

Thanks for all of your help.

Greg
Quote Reply
Re: Upload Mod In reply to
My internet host has never emailed me back, and the problem still exists. Would you be so kind as to send me a link to cgi.pm, and then tell me how to use it with-out having a unix command promot or telnet access.

Thanks
Quote Reply
Re: Upload Mod In reply to
Hey Guys! This is what erols said:
---------------------------------------------

We checked cgi.pm yesterday. Perl is fine, cgi.pm looks good, and other scripts that we have using cgi.pm seem to be working without issue.

It appears that it might be something with the code. We had another developer doing something similar a while back and I think the issue came down to content types.

--Mark

RCN Commercial Hosting
> > > >