Umbraco - Document attachments - File Upload or Content Picker
Hi,
I am looking for the best way to add attachments - is it best for the editor to upload the document to the Media gallery and then use a Media Picker to link to the document or a file upload?
I thought using the Media Picker would be better then the document is stored on the site and not just against the item like the File Upload.
But I am having issues displaying the link to the document when using the Media Picker. It works fine for images using -
@(node.GetPropertyValue("ImageAlias")) - in the
But when trying to include the document in an <a href=""></a> it is just displaying the ID
Thanks for providing this. I wanted to use the media folder for attach documents so that I had more control over the documents so we could have it stored on the server still even if it wasn't in use, as opposed to just attached to the record. I think editors would have found it a bit more worrying if they deleted it etc.
I wanted the URLs to by dynamic as I was including the code in a partial view. I have changed it now to use a Content Picker for pages within the site and a textstring so media items i.e. documents, to just include the URL, and this way I can also include external links as well.
Would be great to see a link picker data type which gave editors the functionality to pick either a page from the site, or browse to a media item or specify a URL, along with specifying the target value.
Umbraco - Document attachments - File Upload or Content Picker
Hi,
I am looking for the best way to add attachments - is it best for the editor to upload the document to the Media gallery and then use a Media Picker to link to the document or a file upload?
I thought using the Media Picker would be better then the document is stored on the site and not just against the item like the File Upload.
But I am having issues displaying the link to the document when using the Media Picker. It works fine for images using -
@(node.GetPropertyValue("ImageAlias"))
- in theBut when trying to include the document in an
<a href=""></a>
it is just displaying the IDand if i use
it displays a #.
Can someone help me with this?
Thanks
Hi Kyle,
If you are using file more than one time - use media library.
If file is only one timer - you can use file upload, but I would prefer media library too.
For getting url of media item use:
Thanks,
Alex
Hi Alex,
Thanks for providing this. I wanted to use the media folder for attach documents so that I had more control over the documents so we could have it stored on the server still even if it wasn't in use, as opposed to just attached to the record. I think editors would have found it a bit more worrying if they deleted it etc.
I wanted the URLs to by dynamic as I was including the code in a partial view. I have changed it now to use a Content Picker for pages within the site and a textstring so media items i.e. documents, to just include the URL, and this way I can also include external links as well.
Would be great to see a link picker data type which gave editors the functionality to pick either a page from the site, or browse to a media item or specify a URL, along with specifying the target value.
Thanks for your response.
is working on a reply...