Site structure
Version 4.x > Site structure > ECommerce - Custom SKU Fields - "File" Field Type - Urls & Storage of files View modes: 
User avatar
Member
Member
Carly Lyddiard - 7/23/2009 1:04:52 AM
   
ECommerce - Custom SKU Fields - "File" Field Type - Urls & Storage of files
Hi guys.

I've added custom fields to SiteManager>System Tables > Ecommerce - SKU. They come up in the Products area in the CMS desk - perfect. Some of the fields are file fields (upload a file).

From the CMS Desk, the files are uploaded properly and can be viewed from the Edit Product page by CMS administrators.

However, I've noticed that the files seem to be treated differently to files uploaded in other parts of the site. For example, they don't conform to the site-wide "store in database" file setting which is switched on - they are stored in the BizFormFiles location in the file system. Furthermore, I can't access these files via GetFileUrl or GetMetaFuleUrl etc, but need to write custom code based on CMSModules\Bizforms\CMSPages\GetBizFormFile.aspx.

Unfortunately this has created inconsistency in my project (most files in DB except for these) as well as requiring me to write custom code to provide access to the files for the user.

I'm aware I can just as easily produce a custom document type for products which would handle files the way I'd like, but separating product data between documents and products in this case is not architecturally desirable.

Questions:
- why are these files treated differently from the others?
- will this be changed in future versions to bring it in line with file handling in the rest of the site?
- do you have any suggestions / recommendations that can make this work better for me?

Perhaps I've missed something obvious that I can do to have the files stored in the database and still be easily accessible to anonymous users/authenticated site members.

Thanks very much :-)

Carly

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 7/28/2009 12:47:34 PM
   
RE:ECommerce - Custom SKU Fields - "File" Field Type - Urls & Storage of files
Hi,

the File field uses File Upload form control, which stores the files as BizFormFiles, because it is convinced that is placed on a BizForm. However it is placed on the "object" so there could be better used some file uploader, which would handle files as MetaFiles for the given object (here the SKU - product).
Unfortunatelly we currently don't have such form control and support in our FormEngine is limited as well.

Posted files are processed by FormEngine so some custom upload control could face the problem that the file cannot be saved before succesfull validation of the form, therefore the control cannot directly solve it and FormEngine doesn't have the support for that...

I'm trying to get more information in discussion with our developers. If it could be made using some customization. It is highly possible that in the future versions this will be improved.

Regards,
Zdenek C.