Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Evan Jardine 108 posts 168 karma points
    Jun 30, 2009 @ 07:53
    Evan Jardine
    0

    Canvas and Upload Datatype

    Is there any tricks to implementing the Upload Datatype and getting it to work in <span style="text-decoration: underline;">Canvas Editing</span> mode?

    I have a section of our site setup to hold meeting agendas and minutes with the following structure;

    -  Meetings

         -  Year

              -  Month

                   -  Meeting Container

                       -  Agenda.. (upload here)

                       -  Minutes.. (upload here)

    Users can browse to the nodes with the file upload and browse for a file and select it.  However nothing gets uploaded after save or publish.

    If you use the umbraco back office everything works fine.

    Thanks

    Evan

  • Richard Soeteman 4054 posts 12927 karma points MVP 3x
    Jun 30, 2009 @ 08:58
    Richard Soeteman
    0

    Hi Evan,

    I've read somewhere  on the old forum that it is not possible to use the upload datatype in Canvas Editing.

    Cheers,

    Richard

  • Evan Jardine 108 posts 168 karma points
    Jun 30, 2009 @ 10:39
    Evan Jardine
    0

    Thanks Richard

    If that is the case, I'll have to re-think my solution.  I was thinking of using a media picker and the media library but can't see how Canvas handles the media library yet.

    Cheers

    Evan

  • Richard Soeteman 4054 posts 12927 karma points MVP 3x
    Jun 30, 2009 @ 11:17
    Richard Soeteman
    0

    Hi Evan,

    I think it has to do with AJAX that cannot handle the upload to well. Maybe you can create your own custom Upload Datatype an work arround issues you have with AJAX and Uploads. I don't know how to create this myself but maybe others do.

    Cheers,

    Richard

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jun 30, 2009 @ 11:55
    Ismail Mayat
    0

    Evan,

    We had an openspace session at codegarden and Thomas Rambaud used an iframe to get the upload field to work.  I will send him an email with link to this post see if he can help you out a bit.

     

    Regards

    Ismail

  • Thomas Rambaud 2 posts 21 karma points
    Jun 30, 2009 @ 13:14
    Thomas Rambaud
    0

    <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-1610611985 1073750091 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {mso-style-priority:99; mso-style-link:"Texte brut Car"; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; font-family:Consolas; mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:"Times New Roman";} span.TextebrutCar {mso-style-name:"Texte brut Car"; mso-style-priority:99; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Texte brut"; mso-ansi-font-size:10.5pt; mso-bidi-font-size:10.5pt; font-family:Consolas; mso-ascii-font-family:Consolas; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:Consolas; mso-bidi-font-family:"Times New Roman"; mso-fareast-language:FR;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} @page Section1 {size:612.0pt 792.0pt; margin:70.85pt 70.85pt 70.85pt 70.85pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} </style> <![endif]--> <p class="MsoPlainText"><span lang="EN-US">Hi Everybody, Ismail,</span> </span>I wasn't talking about the "Umbraco upload field", sorry for the misunderstanding. To make it work in canvas you would need to embed this in an iframe, which is not possible or a bit tricky because you need to modify umbraco source.</span> </span>I was just saying that using file upload fields in canvas is possible by embedding the <input type="file" /> in a form, in an iframe. </span> I've created a usercontrol that handle ajax posted file images.
    </span> </span>This usercontrol contains an UpdatePanel which display thumbs, some useful infos and contains an hidden field named "XMLValue" to store the current value. </span>The usercontrol also contains an iframe (which is outside the updatepanel) with a form, an upload field, and an hidden field named "IsFromIframe". The form action is the usercontrol path.</span> </span>When submitting the form, the usercontrol know that the code is running further to the iframe form submit because Request("IsFromIframe") exists. Then we can get the the file in Request.Files() and save it. When saved I clear the response to write only the iframe content (because only the iframe has been posted and has to restore). Because I have a new image, I need to tell the UpdatePanel "Hey you can reload now and your new value is *", so I add to the response a javascript snippet that changes the hidden field value which is inside the UpdatePanel to trigger an asyncpostback.</span> </span>

  • Thomas Rambaud 2 posts 21 karma points
    Jun 30, 2009 @ 13:22
    Thomas Rambaud
    1

    Arf, i cannot edit or delete my previous post ?

    Hi Everybody, Ismail,
    I wasn't talking about the "Umbraco
    upload field", sorry for the misunderstanding. To make it work in canvas you would need to embed this in an iframe, which is not possible or a bit tricky because you need to
    modify umbraco source. I was just saying that using file
    upload fields in canvas is possible by embedding the input type="file"  in a form, in an iframe. I've created a usercontrol that handle ajax posted file images. This usercontrol
    contains an UpdatePanel which display thumbs, some useful infos and contains an hidden field named "XMLValue"
    to store the current value. The usercontrol also contains an iframe (which is outside the updatepanel) with a form, an
    upload field, and an hidden field named "IsFromIframe". The form action is the usercontrol path.. When submitting the form, the usercontrol know that the code is running further to
    the iframe form submit because Request
    ("IsFromIframe") exists. Then we can get the the file in Request. Files() and save it. When saved I clear the response to write only the iframe content (because only the iframe has
    been posted and has to restore). Because I have a new image, I need to tell the UpdatePanel "Hey you can reload now and your new value is *", so I add to the response a
    javascript snippet that changes the hidden field value which is inside the UpdatePanel to trigger an asyncpostback. The UpdatePanel is now able to change his controls values
    according to the new XMLValue. I hope to be a bit understandable ;) If you want an example of using ajax posted file in liveediting you can download
    my dixxit. umbraco4 project here. Look at the usercontrols. EditorControls. ImgThumbs usercontrol. To test it, simply add a
    reference dixxit. umbraco4. dll in your website, and put the desired editorcontrols in the folder /usercontrols/EditorControls/, now you can create some Ascx datatypes.


  • Evan Jardine 108 posts 168 karma points
    Jul 01, 2009 @ 01:27
    Evan Jardine
    0

    Thanks Thomas,

    I'll have a look and see if it fits in with my solution.  It might take me a while I have only done a small amount of AJAX development so far.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies