Gossamer Forum
Home : Products : DBMan : Customization :

File Uploads

Quote Reply
File Uploads
Hi all, I am having problems trying to get the file upload to work.

The file is uploaded but if I look at the database file it has the path to the file on my C drive rather than the file on the server.

Any ideas greatly appreciated.

Tony

Quote Reply
Re: File Uploads In reply to
I just added the following to the file upload mod.


# IMPORTANT NOTE!!!!!!
# When a file is uploaded, the contents of the Filename field will
# be the path to the file on the computer from which it was uploaded
# and not the path to the file on your server. Don't worry about it.
# This mod includes code which displays the file as it is on your
# server and *not* the contents of the Filename field. The reason
# the field is there is merely to allow you to require all users to
# upload a file. There must be something in the database for the
# script to check.
#
# If the record is modified, and the user does not upload a new file
# the field will be blank. This, too, is the way it's supposed to
# work. I have taken all of this into consideration and the mod
# works just as it's supposed to.


Does this help? Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: File Uploads In reply to
Sorry, but it doesn't. The strange thing is that the picture appears in the upload success bit but not when you do a list all.

Sorry to appear stupid but I spent all day yesterday trying to get this working only to discover that I was copying and pasting from 2 different versions of the file-upload document. I am going blind and thinking of giving up computers to become a monk.

Still scratching my head,

Tony

Quote Reply
Re: File Uploads In reply to
Sorry about the two versions. Some folks want multiple uploads and some folks want single uploads.

Regarding your graphics not showing up when you do a list all, do you have

$rec{$db_key} =~ s/<.?B>//g;

in sub html_record (or sub html_record_long, if you're using the short/long display)?

It should be immediately after

my (%rec) = @_;


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: File Uploads In reply to
my (%rec) = @_;

$rec{$db_key} =~ s/<.?B>//g;

This what I have. I assume the line in between makes no difference.

I just can't see why the picture is there on the page that says that the record has been added successfully and then it disappears when you do a list all. Surely, it uses the same routine to display the record both times?

Tony

Quote Reply
Re: File Uploads In reply to
Yes it does use the same routine. I'll try to explain it.

When you do a "List All," the script searches on the $db_key field and adds bold tags (if you have bolding turned on). Those bold tags are passed to the script and, instead of looking for a file called

1.jpg

it's trying to find one called

<B>1.jpg</B>

It ain't gonna find it.

When you add a record, the key value isn't bolded, so there's no problem.

The line I listed above should remove bolding tags from the key value.

Just for kicks, try turning off the bolding in your .cfg file. Set $db_bold = 0;. See if it works right then.

By turning off bolding (just temporarily), we can see if it is indeed the bolding tags that are causing the problem or something else.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: File Uploads In reply to
YES YES YES YES YES and a million more yeses. 10 million thank yous as well!

That's done the trick!



Quote Reply
Re: File Uploads In reply to
Well, I'm glad it did the trick, but you still might want to have bolding in your search results. I don't know why the line I mentioned before didn't strip out the bold codes. It should.

Seems there's a rash of similar problems lately.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: File Uploads In reply to
hi there iwebnewmedia,
I have been in this problem under unknown action, and have got jpdeni to look into it and it seems that it is only in my host that the file is not loading up, always the same message as directory not wirteable, chmod to 777.
But after reading your post , i am thrill to find that you got yours working with jpdeni advise, so it would not be of much trouble to you if you could let me in as to how your cfg listing of the directory structure for the graphic to be loaded to the site. I am using jpdeni's uf.html.pl and the multi file upload mod. the field defination was added as to the instruction and it looks like i am stuck at this area, hope you could help in any way, note that i am am only a novice in this and have been succesful in getting the secure password lookup mod and change password working but this and the shortlong display mod still not able to get it working. I have tried it with two different sites and both gives the same message. your help would be appreciated.
yours
david fong
ps. I redid the installation again from scratch but still without success.

Quote Reply
Re: File Uploads In reply to
David, one thing I would suggest is that you only install one mod at a time. When you get that mod working, then install another one.

There are sometimes things that overlap between the mods and, if you're having trouble with two mods, it's hard to know which one is causing the problem.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: File Uploads In reply to
dear jpdeni,
ok, I will try it out just with the multi file upload with your uf_html.pl. Iwill give it a try with this and will inform you of the outcome. thanks a mil!.
yours
david fong