Uploading files in Rails

后端 未结 2 1184
野的像风
野的像风 2021-01-24 02:17

I want to make a section in my site where visitors can upload files (pdfs). How can this be done?

Also, after the pdf is uploaded, I need a link to that file. Rather th

2条回答
  •  天命终不由人
    2021-01-24 03:20

    Whilst, not directly addressing the PDF thumbnail issue "The Rails Way" is doing a series on uploading/downloading files with Rails which would be useful with large files like your PDFs.

    Uploading Files: basically, they have an Apache module called ModPorter which speeds up the parsing of the multipart HTTP request containing the upload.

    Downloading Files: use X-SendFile to let Apache serve the download, once your Rails app has performed any user authentication required

提交回复
热议问题