Sam D. wrote:
In my model, I’d like to be able to copy a remote .jpg file from a URL:
I’d like to copy this to my local machine in my model. What
libraries/calls could I make to make this work?
Any help would be appreciated,
The following is what I do to send a file from MY DOMAIN to the client:
Note: Substitute your own mime-type. In this case, p.render is a
method of PDF::Writer. If you read a file into an object then it should
do the same thing (I think).
send_data p.render, :filename => “my_pdf_filename.pdf”, :type =>
OR…you can do this, but I have read some people have concerns because
it exposes your file location and any other file can subsequently be
send_file( path_and_file_name, :type => "application/pdf")
Hope that helps! I’m not an expert so maybe some of the other more
senior people will have a better answer.
mmodica at cox dot net