Uploaded pdf downloads as text and doesn't preview

20 views
Skip to first unread message

keith.b...@gmail.com

unread,
Jun 22, 2015, 6:10:41 PM6/22/15
to canvas-l...@googlegroups.com
Hi,

I'm feeling pretty silly with a canvas upgrade - I'm sure I've done something stupid with the config/setup but I can't work out what.At various times I've had permission problems with /tmp/attachment_fu and I think it worked once, but now I'm completely confuddled.

After successfully uploading a PDF (at least in terms of the UI), the preview (via Google docs) doesn't work. When I try to download the PDF, the result is a text version of the PDF I uploaded.

Looking at the logs during the preview/download, it's serving out a file:

[- b8a23c3c-aae5-4ede-a400-dcda19f720c8] Sent file /var/canvas/tmp/files/0000/0049/1435009513_971__04-Contracting%252BExcercises%252BI.pdf (1.3ms)

That file is on the filesystem and has the text from the original PDF. Something has magically turned it into text.

During upload (log here: http://pastebin.com/M2Y4YNjP) it gives a:

ActiveRecord::RecordNotFound (ActiveRecord::RecordNotFound).

Help?



keith.b...@gmail.com

unread,
Jun 23, 2015, 12:16:50 AM6/23/15
to canvas-l...@googlegroups.com


On Tuesday, June 23, 2015 at 8:10:41 AM UTC+10, keith.b...@gmail.com wrote:
I'm feeling pretty silly with a canvas upgrade -

Worked out what the problem was.

I'd added a config/environments/production-local.rb and tried to enable Apache mod-sendfile by uncommenting:

config.action_dispatch.x_sendfile_header = 'X-Sendfile'

Bad idea. With it enabled, the PDF upload appears with:

content_type"=>"application/download"

With it disabled, the PDF upload appears correctly:
content_type"=>"application/pdf

Obviously something bad with my apache setup.
Reply all
Reply to author
Forward
0 new messages