Copied to clipboard

Flag this post as spam?

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


  • mounir 5 posts 25 karma points
    Nov 11, 2014 @ 00:53
    mounir
    0

    Data source with file upload > Specified Cast is Not Valid

    Hi There,

    Iam using umbraco 6.1.6 and countour 3.0.22 Wip build.14

    A -  when i try to store the location of an uploaded file into my database as nvarchar(max), i have "Specified Cast is Not Valid" error message.

    is there any solution for that ?

    Thanks in advance !!!

     

     

     

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 11, 2014 @ 07:58
    Jan Skovgaard
    0

    Hi Mounir

    What type of file are you trying to upload? And how big is it? Perhaps you need to increase the allowed upload size in your web.config file and add mime types for the type of file you're trying to upload.

    /Jan

  • mounir 5 posts 25 karma points
    Nov 12, 2014 @ 05:44
    mounir
    0

    Hi Jan,

    For my testing I am trying to upload a simple .txt file with a hello world message 

    - If i put the field "docAttachLocation" as File upload in my form -> when i submit i can't have the file location in the email and in the DB

    - If i put the field "docAttachLocation" as mandatory in the form -> i will have : Specified cast is not valid.

    - I have specified nothing in my web.config file and if i create the form without datasource the file will be uploaded into the server without any problem

    is there any solution ? 

    Thanks in advance !!!

     

  • Comment author was deleted

    Nov 12, 2014 @ 09:43

    Thanks for the detailed description mounir, I'll try to reproduce the setup and get back to you with further details

  • Comment author was deleted

    Nov 12, 2014 @ 10:07

    Hmm just tested and the fileupload does the trick, are you sure the error is coming from that bit, if you change it to a normal textfield does it work then? 

    Maybe it's the date field, will give that a try

  • Comment author was deleted

    Nov 12, 2014 @ 10:11

    date also works fine in my setup so not sure where the error is coming from

    If possible could you test the following:

    - Don't include the date field

    - Dont include the fileupload field

    And see in which of the 2 situations you don't get the error

    Thanks,
    Tim 

  • mounir 5 posts 25 karma points
    Nov 12, 2014 @ 17:45
    mounir
    0

    Hi Tim,

    - If i don't include the file upload field > it is working fine

    - If i don't include the date field > still not working  

    Sometimes if i select a file with the file upload > it's not really attached (maybe this is why i have invalid cast )


     

     

     

     

    - Also i noticed that everything is working when i use the preview mode 

     

    am i missing a something in the header ?

    Thanks in advance !!!

  • Comment author was deleted

    Nov 12, 2014 @ 18:12

    Ok in preview mode everything is working so there must be something on your site interfering with the form, any chance you can get the full strack trace for the error, try adding umbdebugshowtrace=true since the error might be coming from a different place then contour

  • Comment author was deleted

    Nov 12, 2014 @ 18:35

    Any chance you made updates to any of the views? Since I can't reproduce atm

  • mounir 5 posts 25 karma points
    Nov 12, 2014 @ 20:26
    mounir
    0

    Hi Tim,

    This is a dropbox link to my the trace log 

    https://www.dropbox.com/s/yndytvv499ks4sd/Binder1.pdf?dl=0

    Thanks !

     

  • Comment author was deleted

    Nov 13, 2014 @ 10:03

    Thanks, unfortunalty it doesn't include any additional details. So in order to debug I'll need a copy of you site and db (since I can't reproduce locally atm), if you can send that to tg at umbraco dot com that would be ace!

    Cheers,
    Tim 

Please Sign in or register to post replies

Write your reply to:

Draft