Upload PDF File

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
axelseaa
Regular
Posts: 49
Joined: Fri Dec 23, 2005 7:13 pm

Upload PDF File

Post by axelseaa »

I'm trying to upload a PDF file and create a link to it in an entry. What is the best way to do this? I can upload the pdf with the "Add Media" option, but when I try to insert it into the entry with the image option, picking link only, it doesn't work. Any thoughts?
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

You should have a "Media" button above your editor. It should do what you want. I know it's worked for me with .zip, .tar.gz, and .xcf files.

The WYSIWYG editor might validate or rewrite the URL or something; try the non-WYSIWYG editor and see if it makes any difference.
Judebert
---
Website | Wishlist | PayPal
axelseaa
Regular
Posts: 49
Joined: Fri Dec 23, 2005 7:13 pm

Post by axelseaa »

judebert wrote:You should have a "Media" button above your editor. It should do what you want. I know it's worked for me with .zip, .tar.gz, and .xcf files.

The WYSIWYG editor might validate or rewrite the URL or something; try the non-WYSIWYG editor and see if it makes any difference.
How is that possible? When i try without the WYSIWYG editor, it tosses in the following:

Code: Select all

<a class='serendipity_image_link' href='/s9y/uploads/GradParty.pdf'><!-- s9ymdb:14 --><img width="" height="" style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;" src="/s9y/uploads/GradParty.serendipityThumb.pdf" alt="" /></a>
which is not even correct, because its not an image.

Any other suggestions?[/code]
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Which PHP version do you use? The recogintion whether a media file is an attachment or image makes use of the PHP getimagesize() functionality.

Plus, I assume you are using s9y 1.3?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
axelseaa
Regular
Posts: 49
Joined: Fri Dec 23, 2005 7:13 pm

Post by axelseaa »

garvinhicking wrote:Hi!

Which PHP version do you use? The recogintion whether a media file is an attachment or image makes use of the PHP getimagesize() functionality.

Plus, I assume you are using s9y 1.3?

Regards,
Garvin
Currently we have php 5.2.0 installed, I have not yet had a chance to install 1.3 - currently still on 1.2.1
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I just tried it on my installation, and it recognized an mp3 was not a file and added it as a plain anchor. None of that s9ymdb stuff.

It obviously believes it can make a thumbnail from the file. Problem is, the thumbnail is empty. If you can delete the thumbnail, it might work as expected. (The thumbnail is filename.s9ythumb.pdf, in the same directory as the file.)

The second attempt would be to actually give it a thumbnail, although not necessarily a true representation of the file.

If that works, then we can start wondering why it created the thumbnail in the first place.
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Thumbnails for PDFs are created when imagemagick is used. usually the s9y code should detect if a PDF thumbnail is used.

I couldn't reproduce this here, it might also be an issue of how the serendipity_images DB table looks like and its mimetype in there. It would be quite easier if I could get a hold on the FTP of the affected installaation...?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply