-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving Umbraco Forms records programatically with file uploads gets "Object must implement IConvertible" error #930
Comments
Your question likely relates to an issue we still have to look into, regarding supporting file uploads via the headless/AJAX API, which is similar to what you are looking to do. Hopefully once we get chance to look at that and release it, you'll be able to use that instead of your own implementation. In the meantime I'd suggest looking at what's stored for upload fields for forms submitted via a normal HTML form - which you'll see is e.g. So you could look at saving the file into the media system, getting the path, and saving that. But I can't really advise what's best here - would have to dig more to find out if you can use what Forms already does, which I think you may be by-passing by going direct to |
Thanks Andy, in the meantime i have been able to achieve the result. |
We have some logic in forms that removes that option if you don't have the built-in upload field in your form, or you do, but there are no files found that are uploaded in the media file system. |
@AndyButland i have found a very important bug. |
We'll close this issue now given the related feature request about file uploads as been actioned, as has the bug report which is also handled via another issue. |
Hi, i am using Umbraco Forms 10.2.0 in Umbraco 10.3.2
I have an api controller that receives IFormCollection values and want to save it to an umbraco form. I have succesfully made it using IRecordFieldStorage, but the problem is when i have a field of type file upload.
I am using axios to post the values, set the header content type to "multipart/form-data" and send the data as FormData so i can received the files.
What i am receiving is a value of type "FormFile" and when i try to save it to the record using InsertRecordField from IRecordFieldStorage i get this error: "Object must implement IConvertible".
Which format is expecting the record field storage to have a file upload?
I cant get the documentation right for that situation. Do i have to manage the file saving and pass the path? i guess the Umbraco Forms api should do that task so i can export the form records with proper file uploads.
The text was updated successfully, but these errors were encountered: