General - .NET User Groups General issues with editing, development and graphic design.
Kentico CMS for .NET User Groups > General - .NET User Groups > Creating New Document & Transformation View modes: 
User avatar
Member
Member
hazana11-gmail - 1/6/2009 5:04:06 AM
   
Creating New Document & Transformation
I have a question regarding the creation of a new document type.

I have created a new document type, and in the fields tab. I have created an new field
Attribute Name: "TechnicalDrawing'
Attribute Type: File,
Field type-Upload file.

Then I have created a transformation to be applied to the document.
In this transformation. I have a link to the uploaded file. so I used this code
<a href='<%# Eval("TechnicalDrawing")%>' target="_blank">Technical Drawing</a>

Then after adding the document with the file uploaded and specifying the transformation. when I click on this link 'Technical Drawing' in the live site I get an error page:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /KenticoCMS1/BuildersHardware/Grohe/Category1/7dfa34b6-79f5-4b78-9b57-3ee1f65a9462.

Why is this. What is the mistake I have done. How should I write the code to link to this uploaded file?
Is there any other way of showing this uploaded file?

Please reply as soon as possible.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/7/2009 5:22:56 AM
   
RE:Creating New Document & Transformation
Hi,

When editing the transformation, at the bottom you can see some examples. Could you please try to use this function to get the URL of the file - <%# GetFileUrl("<fieldName>") %>?

If you do not want to have the GUID of the file in the link, please follow this: http://devnet.kentico.com/Knowledge-Base/API-and-Internals/How-to-display-link-to-a-file-or-document-without-.aspx.

Best Regards,
Juraj Ondrus