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.
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
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?
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
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!
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 !!!
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
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
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
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
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
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
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
Any chance you made updates to any of the views? Since I can't reproduce atm
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
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
is working on a reply...