Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:50:43+00:00 2026-05-27T06:50:43+00:00

I use Flickraw in my test app Follow the example , I can upload

  • 0

I use Flickraw in my test app

Follow the example,

I can upload file by Keying file path , but I want to use form_tag helper

This is my view

= form_tag :upload_photo_to_Flickr , :multipart => true do 
= hidden_field_tag :token, @upload_info[:token] 
= label_tag "PHOTO" 
= file_field_tag :photo 
= submit_tag "Upload Photo" 

Controller is

 def upload_photo_to_Flickr
    file_path = params[:photo]
    flickr.upload_photo file_path , :title => "please" , :description=>"successfully"
 end 

It show error message ArgumentError (wrong number of arguments (1 for 0))

And I also try the other method using read ,

 def upload_photo_to_Flickr
    file_path = params[:photo].read
    flickr.upload_photo file_path , :title => "please" , :description=>"successfully"
 end 

It show error message ArgumentError (string contains null byte)

The params is

{"photo"=>#<ActionDispatch::Http::UploadedFile:0x10ba37648 
  @original_filename="test.jpg",
  @tempfile=#<File:/var/folders/wy/5yx_py3s02g8l0kw0frrpg_m0000gn/T/RackMultipart20111110-   
   1832-18ufrmm-0>,
  @headers="Content-Disposition: form-data; name=\"photo\"; 
  filename=\"test.jpg\"\r\nContent-Type: image/jpeg\r\n",
  @content_type="image/jpeg">,

   "commit"=>"Upload Photo \350\201\236",
   "token"=>"XXXX",
   "authenticity_token"=>"o9PhVeE6u1MGfol/PvGQkLE8RCL5tJat+1AQlygGOKc=",
   "utf8"=>"\342\234\223"
}

How to get file path ?

Because It can work like this

def upload_photo_to_Flickr
  file_path = "/Desktop/test.jpg"
  flickr.upload_photo file_path , :title => "please" , :description=>"successfully"
end 

Or I have to try another method to get file path instead of form_tag ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:50:44+00:00Added an answer on May 27, 2026 at 6:50 am

    I find a solution!

    In controller , using

    flickr.upload_photo(params[:photo].tempfile.path)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

use warnings; use Test::More; use File::Find::Rule; use Test::File::Find::Rule; my $rule = File::Find::Rule->file->name('*.pl')->not_grep(qr/^\s*use\s+strict;/m, sub {
Use case: we have some project meta-data files which we want tracked, but are
Use case is this: I want to unit test (in browser, QUnit or something
Use case: 3rd party application wants to programatically monitor a text file being generated
use this website a lot but first time posting. My program creates a number
Use case: I've just entered insert mode, and typed some text. Now I want
Use case: User launches app The user enters google password The app lets the
Use case example: Client A comes to request sales information, enters their zip code
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
Use Selenium a lot, but wondering the folowing question Just a little bit curious,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.