質問

I have a app for iOS and I have the user pick a image with a UIImagePickerController. How can I upload that image to my rails app using dragonfly. I think I would use multipart-image-data but I don't know how I would do this.

役に立ちましたか?

解決

Easiest way to do it would be to hand off the "bag of bits" (data of the image) to AFNetworking to upload it your rails application.

EDIT To answer your question about how to handle the upload, you could do something like this. Remember to set the name used in AFNetworking is the same as the params key

def uploadFile
    post = DataFile.save(params[:upload])
    render :text => "File has been uploaded successfully"
end
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top