Groups
Groups
Sign in
Groups
Groups
Ruby on Rails: Talk
Conversations
About
Send feedback
Help
How can I delete a file?
1,763 views
Skip to first unread message
John Smith
unread,
Jan 11, 2009, 1:48:55 PM
1/11/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
I want to delete a file that is in
public/system/photos/original/1/photo.jpg. How can I delete it?
--
Posted via
http://www.ruby-forum.com/
.
John Yerhot
unread,
Jan 11, 2009, 6:14:33 PM
1/11/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
Check out the File class.
http://www.ruby-doc.org/core/classes/File.html#M002559
File.delete("#{RAILS_ROOT}/public/system/photos/original/1/photo.jpg")
That should do it.
-John
On Jan 11, 12:48 pm, John Smith <
rails-mailing-l...@andreas-s.net
>
wrote:
John Smith
unread,
Jan 12, 2009, 3:02:36 AM
1/12/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
John Yerhot wrote:
> Check out the File class.
>
http://www.ruby-doc.org/core/classes/File.html#M002559
>
> File.delete("#{RAILS_ROOT}/public/system/photos/original/1/photo.jpg")
>
> That should do it.
>
> -John
>
> On Jan 11, 12:48�pm, John Smith <
rails-mailing-l...@andreas-s.net
>
Thanks a lot! I will try iy.
Reply all
Reply to author
Forward
0 new messages