Advertisements

file uploading error

Postby santattech » Tue Mar 29, 2011 4:45 am

Offline
santattech
Posts: 2
Joined: Tue Mar 29, 2011 4:36 am
Location: India
my view file is like this..

<form action="/uploadFile" method="post" enctype="multipart/form-data">
<label>Select :
<input type="file" name="upload" />
</label>
<input type="submit" value="upload" />
</form>

but when i click on the upload buton it throws error.. ActionController::InvalidAuthenticityToken in UploadController#uploadFile and the parameters passese as {"upload"=>#<File:C:/WINDOWS/Temp/RackMultipart20110329-2804-8zapc3-0>} thogh i browsed for d:/cv.txt

my uploadFile action is like

def uploadFile
post = DataFile.save(params[:upload])
render :text => "File has been uploaded successfully"
end

and the DataFile.save method is same shown in the tutorials here... http://www.tutorialspoint.com/ruby-on-r ... oading.htm

can anyone help me?plz..
my skype id is santattech.. u can send me the request.. so that we can solve problems on discussions..

Postby tutorialspoint » Sat Apr 02, 2011 1:34 am

Offline
tutorialspoint
Site Admin
Posts: 143
Joined: Fri Apr 27, 2007 6:52 pm
May be you are using different version of RoR. Just check your version.

Thanks

ยป

Postby santattech » Sat Apr 02, 2011 12:55 pm

Offline
santattech
Posts: 2
Joined: Tue Mar 29, 2011 4:36 am
Location: India
thanx for the reply.. I am using ruby version 1.8.7 and rails 2.3.4.. and mysql 5.0... which version is acceptable?
my skype id is santattech.. u can send me the request.. so that we can solve problems on discussions..