Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hi all,

I'm hoping this is an easy thing I'm just missing. I'm building a site that needs to have multiple types of upload capability, which is easy enough. The problem I'm having is that my upload window in KCFinder always defaults to "image". I can make sub-folders within that, but what I need is to make a "pdf" folder one level up, in the "admin/uploads" folder. Ideally then I'd be able to choose to upload things to either "pdf" or "image" through the admin, depending on what I'm doing. I don't really want my folder trail reading "uploads/image/pdf/file.pdf"

Is this possible?

Thanks in advance!
I suppose you are using DataBound Forms.
If that is the case, use type='securefile' while defining the editable region.

@KK Sir
As a security measure, the file-explorer (KCFinder in later versions) component is restricted to only admins and super-admins.

For non-admins, ideally you should use 'securefile' region to allow uploads from the front-end.


In the the editable region definition you can define which all extensions will the field support.
You can find more details here: viewtopic.php?p=12865#p12865

Regards,
GenXCoders
Image
where innovation meets technology
@webinke,

You can move the entire 'ulpoads' folder from within the default 'couch' folder to within the site's root by setting the following in config -
// 12.
// Upload folder if not using the default upload folder within 'couch'.
// Should be relative to your site (don't forget to set write permissions on it).
// No leading or trailing slashes please.
//define( 'K_UPLOAD_DIR', 'myuploads' );

That will remove your admin folder's name from the URLs of uploads. This, however, will still place all type 'image' editable region uploads within 'image' subfolder of the designated upload folder. So, this won't solve your problem completely.

As a workaround, perhaps, instead of type 'image', you can try using type 'file' editable regions for the uploads?
This way you can upload files of all types (including images) and those will be placed within a subfolder named 'file', So, for example, a sample URL would be -
uploads/file/pdf/file.pdf

Of course, by uploading images as files you lose the cropping/resizing/thumbnail facilities offered by type 'image' region.

Unfortunately, those are the only options available currently.
I just wanted to post on this and let you know that the solution I needed actually ended up being super simple. The use of the type="file" and repeatable regions actually gave me the perfect setup for what I needed to do. Since the type="file" uploads into the other directory in the admin side, it works.

My end goal was for my client to be able to upload pdfs and name them, without having to mess with any HTML code. Now they just enter in 2 fields, and my repeatable regions and CSS take care of the rest.

I wouldn't have thought to look at it this way without your help @kk and @genxcoders

Thanks again guys!
KK wrote: @webinke,

...Of course, by uploading images as files you lose the cropping/resizing/thumbnail facilities offered by type 'image' region....

I have not been able to find any cropping/resizing facilities in the current CouchCMS (via kcfinder)0. KK, were you referring to an image or file manager that was used in a previous version of Couch?
@lstandish, I actually had in mind the automatic crop/resize that happens when width/height params of type 'image' editable region are specified. Also, the type 'thumbnail' and 'jcropthumb' both work only with images present in the default 'image' folder.

Hope this clarifies the doubt.
KK wrote: @lstandish, I actually had in mind the automatic crop/resize that happens when width/height params of type 'image' editable region are specified. Also, the type 'thumbnail' and 'jcropthumb' both work only with images present in the default 'image' folder.

Hope this clarifies the doubt.

I had forgotten about the automatic resizing (and wasn't even aware of automatic crop). Thanks for the clarification.
7 posts Page 1 of 1
cron