Gossamer Forum
Home : Products : DBMan : Customization :

Upload Mod

(Page 1 of 3)
> >
Quote Reply
Upload Mod
JP
I am not sure why this upload mod is not working on my system. I have emailed the server administrator for help with double checking the permissions. Is there anyway that I could post the script that I have running for you to look at?

http://207.96.11.60/jpdeni/db.pl
http://207.96.11.60/jpdeni/html.pl
http://207.96.11.60/jpdeni/file-upload.pl
http://207.96.11.60/jpdeni/default.cfg

Also, I have two maps of Somersetshire
http://207.96.11.60/jpdeni/somersetshire.jpg
let me know if you are interested and I can cut you a break on the price for all of your excellent help with dbman.

------------------
http://www.antiqueexchange.net
Quote Reply
Re: Upload Mod In reply to
You can save the files as .txt files, so that JPDeni and others can access them. We will not be able to access the files in their current extensions. Save the files as text files.

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
Thanks!

They are now all *.txt file in the same location.

except for the one *.jpg Smile

Quote Reply
Re: Upload Mod In reply to
Those Somerset maps are gorgeous!! Lemme think for a little bit about buying one. (Naturally, I like the 1837 one the best! Smile )

Did I have you try to use the original upload script -- the one that I used for the mod? If not, try picking it up at http://www.terminalp.com/...ts/file_upload.shtml . Configure it and install in on your server to make sure it works for you.

(I think I mentioned this to someone, but it may have been someone else.)


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





Quote Reply
Re: Upload Mod In reply to
I do not believe that it is a corrupted cgi.pm, because we have been uploading pictures with this script all along. And only now has it started it make them look like goop.

Until this point, I could open the "CGItemp1830001" files with image composer and see what they were.

I am pleased to say, except for this bug, it seems to be working (even though this is a major bug...)
Quote Reply
Re: Upload Mod In reply to
you know what! I got the original file-upload.pl to work, and it's files are corrupted too. Maybe it is the CGI.pm that is goop
Quote Reply
Re: Upload Mod In reply to
I'm getting a broken image with the URL http://www.heritageantiquemaps.com/auction/orders/database/userupload

Please do not try uploading any files right now. Please let us work through the debugging one thing at a time.

What I've been giving you has not been for the solution, but an attempt to find out what the solution is.

Let's start this from scratch, shall we?

I need you to upload a graphic -- make it a .jpg. -- to the directory where you want your images to be uploaded. Rename that file to 1.jpg.

Remove the following from html.pl:

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;
}
}

Replace it with:

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>|;
}

You'll notice that I changed the case of the path to all lower case. This could be part of your problem.

Again, do not try to upload a file right now -- not until we know that it can find the right directory. This is the easiest way to do it.


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





Quote Reply
Re: Upload Mod In reply to
JP,

Before I make do the above mod, I just wanted you to know that the files seem to be finding the right directory. There are several in there already.

Do you want me to go ahead and do the mod still?

Greg
Quote Reply
Re: Upload Mod In reply to
Actually, it does seem to be finding the path now. But there are still broken images. Are these the corrupted files?

If so, I think there may be a problem with your CGI.pm. You can ask your ISP admin to reinstall Perl, which includes the CGI.pm file or you can upload the files yourself.

If you upload your own files, you have a choice there, too. You can either rename the files to match the key values of the records -- 1.jpg -- or you can fill in the full URL of where the image is in your image field and dispense with this altogether.


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





Quote Reply
Re: Upload Mod In reply to
anything that I upload becomes corrupted. I have contacted my provider and told them about the problem. I will let you know what they say.

Thanks for all of your good work! With luck I can get this working very shortly...

Greg

p.s. I don't want to have to have to upload the file with FTP and then write out the full url of the file in the Database form, so that is why I wanted the upload mod.

Quote Reply
Re: Upload Mod In reply to
I do understand your "PS." You can use part of the upload mod, though, at least until you can get the actual uploading correct. Do like I had you do before -- FTP a graphic and change the name to the same name as the key value of the record. Then you don't have to type in the full URL to the graphic.

If you get the upload mod working later, everything will be in place, but you can still work on your database in the meantime.


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





Quote Reply
Re: Upload Mod In reply to
Hey,
I downloaded the original script, and tried to configure it to run, but when I did I got a "script produced no out-put" error. Then I read the "readme.txt" file that cam with it and it said...

Q: My server runs on Windows NT... Is there any way I can use the File-
Upload script?
A: Unfortunately, no. I attempted to port a previous version of the
File Upload! script to Windows NT, however the differences in the file
system proved to much for a single script that would work on both
Windows NT and Unix.

-----------------------------------------

Now, I think that Elliot had mentioned that the script works for him on an NT-server that he setup. So is there anyway to modify it so that it would work on mine?

The strange thing is that dbman, with the upload mod, works! BUT it does not work well at all!!! It uploads that files, but does not put them in the directory that I want them to, it also generates an error rather than associating the file with the database entry.

This is way beyond me! I really need your help jp or elliot!!!
Quote Reply
Re: Upload Mod In reply to
Maybe we can work things out anyway. But it's going to take some debugging work on your end.

Upload a graphic to your graphics directory, using FTP, that matches one of your records. Give the graphic a name that matches the key value of the record. For example, if the graphic is a .jpg and it matches the record whose key is 1234, name the graphic 1234.jpg. Then try viewing the record and see if the graphic comes up in the display.


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





Quote Reply
Re: Upload Mod In reply to
I have uploaded the file 0001.jpg to accompany record 1, but the file is not displayed anywhere on the screen.
Quote Reply
Re: Upload Mod In reply to
I have uploaded two files named 0001.jpg,

one is in the database directory
and the other one in the database/userupload directory.

Neither of them show up when I use the "list all" function.

Greg
Quote Reply
Re: Upload Mod In reply to
If your record key value is 1, then the name of the file needs to be 1.jpg. They need to match exactly. Be sure to upload the file into whatever directory you have defined as the $SAVE_DIRECTORY in your .cfg file.

I hadn't looked at your .cfg file before. I probably should have. You have

$SAVE_DIRECTORY = "greg";

I can just about guarantee that is not correct. This needs to be the full path to the specific directory where you want the graphic files to be.

When you upload your files using FTP, look at the path to the directory that's shown within your program. I think if you're using NT, it should be something like
D:/something/something/greg

or maybe it's on the C: drive.

One other thing to be aware of is that, while your path may look like
D:\something\something\greg

you need to use / instead of \.


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





Quote Reply
Re: Upload Mod In reply to
Carol,
This is going to be long, so I am going to break it down into sections.

Part (I)
I tried it again with 1.jpg, (in both directories) and it did not work.
---------------------------------------------

Part (II)
Also, the files that you looked at we a bit out of date, that is my fault and I am sorry. I have refreshed the files in the jpdeni directory to match what I am actually using. Here are the links again.

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
---------------------------------------------

Part (III)

My server is a bit strange, I have learned that it almost never accepts anything like:
"/auction/orders/database/userupload"

It always has to be in this format:
"d:\\inetpub\\wwwroot\\heritageantiquemaps\\auction\\orders\\database\\userupload"

though I will try the other formats and let you know if they work or not. But as I said before, I can delete that line all-together and the script still does the same things.

---------------------------------------------
Part (IV)
I have talked to the my service providers and they have assured me that all of the permissions are set correctly. They have even gone through and re-did all of them again for me.


Thanks for all of you help!

Greg
Quote Reply
Re: Upload Mod In reply to
The following $Save_Directory paths produce the same output. (with the exception of having the file called something different each time)
CGItemp1830001
CGItemp1830002
CGItemp1830003
CGItemp1830004
CGItemp1830005

"d:maps1/auction/orders/database/userupload"

"d:/maps1/auction/orders/database/userupload"

"/auction/orders/database/userupload"

"d:\\inetpub\\wwwroot\\heritageantiquemaps\\auction\\orders\\database\\userupload"

"Greg"

Quote Reply
Re: Upload Mod In reply to
Carol,
I have tried to # each of the error messages, like this (and more other ways that I will not post)

# $message = '';
# if (!(-e $SAVE_DIRECTORY)) {
# $message = "The directory doesn't exist. Make sure that this directory is a complete path name,\nnot a URL or something similar. It should look similar to\n/home/username/public_html/uploads";
# }
# if (!(-W $SAVE_DIRECTORY)) {
# $message = "The directory isn't writable. Make sure that this directory is writable by all users.\nAt your UNIX command prompt, type chmod 777 $SAVE_DIRECTORY";
# }
# if (!(-d $SAVE_DIRECTORY)) {
# $message = "The directory you specified isn't really a directory.\nMake sure that this is indeed a directory and not a file.";
# }
# if ($message) {
# &cgierr;


and if I # all of them out then I get the following Software error:

Execution of d:\inetpub\wwwroot\heritageantiquemaps\auction\orders\database\file-upload.pl aborted due to compilation errors.
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error. ;
Quote Reply
Re: Upload Mod In reply to
The URL for default.txt gave me the .log file. Smile

Where did the files end up? Which directory?

When the file is uploaded, it first goes to a temporary directory, with a temporary name, just like the ones you listed. What's supposed to happen then is that the file is added into the appropriate directory, with the appropriate name and the temporary file is deleted.

Could you try the following as paths:

d:/inetpub/wwwroot/heritageantiquemaps/auction/orders/database/userupload

/heritageantiquemaps/auction/orders/database/userupload

One other question. Where is your db.cgi file in terms of path, not URL?




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





Quote Reply
Re: Upload Mod In reply to
http://207.96.11.60/jpdeni/default.txt works now
it has some of the answers that you are looking for. I will try the other paths and then get back to you
Quote Reply
Re: Upload Mod In reply to
If I take our the # from infront of the error part of file-Upload.pl then I get this error instead:
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.


---------------------------------------------
I have tried the two paths that you said to and neither of them worked. ::
Quote Reply
Re: Upload Mod In reply to
Try using the paths that JPDeni gave you.

On NT, the appropriate paths are the following:

d:/InetPub/wwwroot/myaccount/directory/

One major problem you have in the configuration is the inclusion of the $db_script_path with the directory path. The server is unable to interpret this properly. It is interpreting the path in the following manner:

Code:
d:\\inetpub\\wwwroot\\heritageantiquemaps\\auction\\orders\\database\\auth\\d:\\inetpub\\wwwroot\\heritageantiquemaps\\auction\\orders\\data base\\auth

In your configuration you have to set-up your file and directories EITHER of the following methods:

Example 1:

With the db_script_path variable defined in the db.pl file as:

Code:
$db_script_path = "D:/Inetpub/wwwroot/heritageantiquemaps/auction/orders/database";

(Note: With NO trailing slash.)

Code:
$db_file_name = $db_script_path . "/default.db";

Example 2:

Without the db_script_path denoted in the default.cfg file:

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

ALSO, use the exact name of the directory (case sensitive). Most IIS directories are set-up with inetpub as InetPub.

Does this make sense??

Repeat this for the other files and directories.

If this does not make sense, then email me at eliot@anthrotech.com and I will send you my default.cfg file as reference.

Question:
What Errors do you receive when you try to upload the files?

Hope this helps.

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).]

[This message has been edited by Eliot (edited September 02, 1999).]
Quote Reply
Re: Upload Mod In reply to
Ok, I have done as Elliot said and changed my Default.Cfg file. It made a lot of sense when he explained it, and I really thought that may of been the problem. But alas,


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.

---------------------------------------------
the same exact error as before!

Anyway, here the files are again, they are what I am actually running. And are up-to-date.

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
Quote Reply
Re: Upload Mod In reply to
Greg, you have a number of problems with your .cfg file. I think we need to get them sorted out before working on the upload mod.

One thing is the problem with the paths that Eliot talked about. Your database will not run with the paths set the way they are.

Other things I see --

In your select fields, you have both a comma and a space between the options. You need to have just a comma:

Code:
Wrong:
Condition => 'excellent, fine, wonderful, good, average, fair, poor,'
Right:
Condition => 'excellent,fine,wonderful,good,average,fair,poor,'

You need to do that with all of your select fields.

You probably will want to change your authorization options before you go "live." At present, your customers would have to log in before they could see the maps and then they would be able to modify or delete any record they wanted to. This is probably not a good idea.

You have a userid field:
Code:
Userid => [14, 'alpha', -2, 15, 0, '', '']

but you also have

Code:
$auth_modify_own = 0;
$auth_view_own = 0;

The userid field is unnecessary unless there is going to be some restriction on what users can do with the records they create.

The biggest problem, though is
Code:
$auth_user_field = 9;

By not changing this from the original, you will never get the text you want in your Keywords field, which is field 9 in your database. You will always get your userid in that field.

You need to change it to
Code:
$auth_user_field = 14;

if you keep your Userid field, or to

Code:
$auth_user_field = -1;

if you take out the Userid field.

It's really not a good idea to add any modifications until the basic database is working. It makes it harder to find problems later on.


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





> >