Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
a51811de
Commit
a51811de
authored
Jun 28, 2011
by
Alex Godin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed self.path to self.original_filename to avoid issues like issue #201
parent
c17a358e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
+1
-1
lib/paperclip/upfile.rb
+1
-1
No files found.
lib/paperclip/upfile.rb
View file @
a51811de
...
@@ -6,7 +6,7 @@ module Paperclip
...
@@ -6,7 +6,7 @@ module Paperclip
# Infer the MIME-type of the file from the extension.
# Infer the MIME-type of the file from the extension.
def
content_type
def
content_type
type
=
(
self
.
path
.
match
(
/\.(\w+)$/
)[
1
]
rescue
"octet-stream"
).
downcase
type
=
(
self
.
original_filename
.
match
(
/\.(\w+)$/
)[
1
]
rescue
"octet-stream"
).
downcase
case
type
case
type
when
%r"jp(e|g|eg)"
then
"image/jpeg"
when
%r"jp(e|g|eg)"
then
"image/jpeg"
when
%r"tiff?"
then
"image/tiff"
when
%r"tiff?"
then
"image/tiff"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment