I've got a rails 4.0.5 app that creates a zip file and then sends it to the user via send_file. Per the api docs, "disposition" is "attachment" by default, the environment is configured to use config.action_dispatch.x_sendfile_header = "X-Sendfile" for apache, and apache is configured to recognize this in the vhost.
The problem is that I can download these attachments properly from my home or work network, but clients in another state are receiving zero-byte attachments. They claim there is no firewall interfering with .zip files.
Any ideas on what could be causing this?
Related
I'm trying to write code to download a folder from a FTP server. I looked at the support on gems for ftp downloading. So far, I see syncftp gem is updated most often. Do we have any other options for FTP gem similar to syncftp?
If not, can anyone show me how to download a whole folder from a ftp server connection. I'm able to establish FTP connection and get the list of files from it, but I don't know how to download the entire folder.
I've been trying to set up a web server using EC2 on Amazon web services.
Using the appstack-nginx-passenger-ree AMI, I tried to set up the server.
I put my ruby files in /opt/sites and I installed passenger and apache2-dev & apace2-mpm-fork.
I had to set up the apache config file.
Afterwards what should I do?
How do I set the path file of the ruby files and deploy them?
How can I start up the server and be able to look at it?
You should make sure you start up apache (which should show you a default welcome page on your the IP of you box (if you have opened up the firewall)), then setup the path to your ruby project in your httpd.conf file.
Here's a guide that might help you out
Paul, your link is broken, the corrected link for the guide is this Setting up Rails 3 on Amazon EC2 instance
I have a rails application running on Nginx which needs to serve files for download from another internal server. The internal server uses a dynamic url to generate the file for download, so it isn't a static file sitting in a folder. Both the rails server and server with the files are on the same LAN but only the rails server is open to the public on port 80.
Additionally the files that I'm wanting to serve are anywhere from 5GB - 200GB so I don't want to tie up the rails process for the whole download if that is possible. Is there a way to do this with Net::HTTP + send_data? Or perhaps some kind of Nginx proxy rule?
From inside the LAN you can download a file with a url like this:
http://username:password#192.168.0.5/export?uuid=1234567890
The problem is 1) there is no access control for that url, with the user / pass you can download any file you want by passing in it's uuid parameter and 2) the server is only LAN accessible.
I figured out the answer to this question by following the tutorial here: http://kovyrin.net/2010/07/24/nginx-fu-x-accel-redirect-remote/
To handle the HTTP Basic authentication you need to add this line to your nginx config:
proxy_set_header Authorization "Basic BASE64_USER_PASS";
Where BASE64_USER_PASS is a base64 string of your username and password in the format "user:pass"
I'm currently developing on my local pc, to which I have complete access of course.
However to my production server I have only FTP access.
Now, this step
http://www.symfony-project.org/getting-started/1_4/en/05-Web-Server-Configuration
On Symfony's installation guide, suggests that I need to edit the httpd.conf
I was wondering if there's an alternative since I don't have access to it on production.
Try reading this. I haven't tried installing Symfony on a shared host, but I see no reason for it not to work.
Generally shared hosts allow you to set configuration parameters in .htaccess files, so you can override httpd.conf without modifying it.
We have a big problem with downloads when the size is over than 1gb.
We are using Rails 2.3.5, passenger 2.2.9 on Amazon EC2 2gb with 2gb of Ram and Fedora 10.
Files are stored on /mnt/files, project is on /mnt/www/project
We tried to send files with Nginx and x-accel-redirect and also Apache with x-sendfile.
We can download only and always 1.09gb instead of 1.54gb!!
We can download files without problems where size is less than 1gb
If we link same file (that is not corrupted) in rails public dir, we can download without any problem.
X-Accel-Redirect or X-SendFile are configured correctly, tested and checked a lot of time.
So:
Nginx with x-accel-redirect [fail]
Apache with x-send-file [fail]
Send File without x-accel-redirect or x-sendfile on nginx or apache [fail]
Linking file in public and direct download [works]
Any suggestion?
Thanks!!!
If you're looking to restrict access to these downloads, have you tried the Access Key module?