Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Problem viewing uploaded pdf/doc files

Quote Reply
Problem viewing uploaded pdf/doc files
Hi,

I've set up a table so that users can upload .pdf or .doc files. They're able to upload the files fine, but I'm not sure what url I should use for downloading. I tried using the standard one I would use for images:

/PATH/TO/db.cgi?db=TABLE_NAME&uid=default&do=view_file&cn=COLUMN_NAME&id=PK_COLUMN

But with that url, a pdf file just came up as gibberish. I think it failed to send the proper headers to the browser to indicate that it was a pdf file. Is there a fix for this?

Thanks very much.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Problem viewing uploaded pdf/doc files In reply to
Can you send me username and password to access the admin panel via email? I'll test it out.

TheStone.

B.
Quote Reply
Re: [TheStone] Problem viewing uploaded pdf/doc files In reply to
Thanks! Sent you a PM.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Problem viewing uploaded pdf/doc files In reply to
Quick follow up - Does DBManSQL permit the upload and viewing of a PDF file?

I had always thought so - but doing some tests out of the box, I get gibberish when trying to view. Says something about a corrupted PDF file. Tried several "freshly" made pdfs so they are good.

(Doing this locally on a Windows machine/ Apache if it makes a difference).

Many Thanks
John
Quote Reply
Re: [gatman] Problem viewing uploaded pdf/doc files In reply to
Hi John

I have found out that PDF files can be viewed correctly once a user has logged into the system. But I'm experiencing the same problem like you do once I've logged off the system. I have a feeling that it has something to do with authentication. The URL mentioned above seems to be correct. Just give it a try and use this URL once you've logged into DBMan SQL and tell me if it works for you, too.

Let me know what happened
Oliver
Quote Reply
Re: [olivers] Problem viewing uploaded pdf/doc files In reply to
Doesn't appear to be an authentication issue. Corruption here occurs regardless of log-in status and occurs either trying to download file or view.
Quote Reply
Re: [gatman] Problem viewing uploaded pdf/doc files In reply to
Hello again,

have you tried to access the file via "direct" URL to verify if your PDF has been properly uploaded to the server? A direct URL would not have db.cgi in the URL, but point directly to the appropriate file upload folder:

yourdomain.com/path/to/fileuploadfolder/X/filename.pdf

where X would be a number - you have to find out in which folder your PDF is located (# 0 - 9). You could also search&download the PDF via FTP and verify the file locally on your client machine if you prefer.

If the PDF can be viewed without problems, then it's not a file upload problem but might have something to do with the file viewing routines.

Cheers,
Oliver
Quote Reply
Re: [olivers] Problem viewing uploaded pdf/doc files In reply to
Ok - thanks for claryifying.

Interestingly - just tried this on the hosting account and it does work. No problems (FreeBSD/Apache).

May be this is the way Windows is interpreting the script / managing the MIME type?

Dunno.
Quote Reply
Re: [gatman] Problem viewing uploaded pdf/doc files In reply to
Glad to hear that at least the upload thingy is ok on your system Smile

I forgot to ask you the following: Which version of DBMan SQL have you installed? I'm not sure if it has something to do with this, but maybe another question: which versions of File.pm and Home.pm are on your server (have you ever replaced one of these files)?

Oliver
Quote Reply
Re: [olivers] Problem viewing uploaded pdf/doc files In reply to
Using last available version 2.10 - and have not modified home.pm or file.pm - are there more current version relative to this?
Quote Reply
Re: [gatman] Problem viewing uploaded pdf/doc files In reply to
Look at these URLs:

Home.pm: http://www.gossamer-threads.com/...i?post=228308#228308
File.pm: http://www.gossamer-threads.com/...i?post=224973#224973

I've noticed that there is a newer version of File.pm (see link above): v.1.54 - But unfortunately, it doesn't seem to fix the problem you've described (or it has nothing to do with it) Unsure

Good luck and let me know once you find a workaround
Oliver
Quote Reply
Re: [olivers] Problem viewing uploaded pdf/doc files In reply to
Have you been able to solve the problem? I'd be interested in a feedback...

Thanks,
Oliver
Quote Reply
Re: [olivers] Problem viewing uploaded pdf/doc files In reply to
Is there a solution to this problem?