Skip to content

Commit ce5754b

Browse files
committed
fix: upload dir issue
1 parent 3d90b7b commit ce5754b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/imagekitio.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ def filename
2929
if options!=nil
3030
@options=options
3131
end
32+
folder=nil
33+
begin
34+
folder=store_dir
35+
rescue
36+
end
37+
38+
if folder!=nil
39+
@options[:folder]=folder
40+
end
41+
3242
if self.file!=nil
3343
base64=Base64.encode64(::File.open(self.file.file, "rb").read)
3444
resp=@imagekit.upload_file(open(self.file.file,'rb'),self.file.filename,@options)
@@ -65,8 +75,12 @@ def url
6575
def options
6676
options={}
6777
end
78+
79+
def store_dir
80+
store_dir=nil
81+
end
6882
end
6983

7084
end
7185

72-
end
86+
end

0 commit comments

Comments
 (0)