Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create dynamic folder #88

Open
jkz2011 opened this issue Aug 11, 2011 · 3 comments
Open

How to create dynamic folder #88

jkz2011 opened this issue Aug 11, 2011 · 3 comments

Comments

@jkz2011
Copy link

jkz2011 commented Aug 11, 2011

Hi Jose,

I'm using meioupload ver. 2.2 and works fine. It is now store the uploaded files into static directory

/upload//filename/

I want to put the uploaded files into dynamic folder such as the main id of a documents

/upload//filename/<document_id>

How to do that?

Thanks

Ardhi

@joshuapaling
Copy link
Contributor

Hi Ardhi,

If you pass in something like:
'dir' => 'uploads{DS}{ModelName}{DS}{fieldName}',
as one of your parameters, then MeioUpload will replace "{ModelName}" with your model name, and "{fieldName}" with your field name automatically.

eg. If your model is Blogs and field is 'feature_image' then the uploads will be at "uploads/blog/feature_image'.
I don't know if that solves your problem, but that's as far as MeioUpload goes at the moment, I'm pretty sure.

@jkz2011
Copy link
Author

jkz2011 commented Sep 13, 2011

Thanks for your reply. Actually I need to replace {fieldName} with the content of that field, not with the name of the field. So it would be changing dynamically depends on the contents.

Suppose something like this :
'dir' => 'uploads{DS}{ModelName}{DS}mytable.field'

If the content of the field is car, truck and van then it would upload to the appropriate folders : car, truck or van.

Thanks.

------Original Message------
From: joshuapaling
To: .me
Subject: Re: [MeioUpload] How to create dynamic folder (#88)
Sent: Sep 13, 2011 10:06

Hi Ardhi,

If you pass in something like:
'dir' => 'uploads{DS}{ModelName}{DS}{fieldName}',
as one of your parameters, then MeioUpload will replace "{ModelName}" with your model name, and "{fieldName}" with your field name automatically.

eg. If you're model is Blogs and field is 'feature_image' then the uploads will be at "uploads/blog/feature_image'.
I don't know if that solves your problem, but that's as far as MeioUpload goes at the moment, I'm pretty sure.

Reply to this email directly or view it on GitHub:
#88 (comment)

@joshuapaling
Copy link
Contributor

OK I see what you mean. Meio Upload can't do that. You'd need to write the enhancement yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants