Hi to all,
i'm trying to upload a pdf or doc file on my server. My code works under linux, but now i move my app to a windows server and the documents (both pdf and doc) are not uplaoded correctly.
Here it's my form code in the view:
<%= form_tag( { :action => 'create' }, :multipart => true ) -%>
<p><label for="nominee_cv">Cv</label><br/> <%= file_field 'nominee', 'cv' %></p>
<%= submit_tag "Next" %> </form>
and this is my controller:
if(@nominee.cv != "") file_field=@nominee.cv rescue nil
ext=file_field.original_filename.to_s.split('.')
File.open("#{$path}/public/cv/#{@nominee.id}.#{ext[1]}", "w") { |f| f.write(file_field.read)} @nominee.cv="/cv/#{@nominee[:id]}.#{ext[1]}" end
Can anybody help me???
Thanks in advance
Andrea