How can we create file type uploader for custom user registration form ?

Rasiuddin Khan asked on February 7, 2017 16:40

Dear Team,

Can you please help me for file upload, I want to file upload feature on my custom user registration form like CV Attachment,Profile Picture,Other Document upload.I want same feature like data type :File which only available for Page Type & Online Form.I don't know why not this feature available for Custom table & new custom user registration field.can you help me to how i create File Type upload in Custom table & user registration and Its work for Update user profile as well.I have some idea to upload file on Media gallery but i don't want,I want to upload file in only like any upload happen using Online Form File Type control.

Thanks & Regards Rasiuddin Khan

Recent Answers


Trevor Fayas answered on February 7, 2017 17:18

I believe the reason why you can on Pages and Files and can't on Custom Tables/User Registration is because there is a specific "Attachment" database table that links attachment files to Documents on the tree, where as Custom Tables and User Settings do not have that, nor the ability to set a Binary type field.

Forms have a Data Type "File" (binary), so that can accept a file.

So that being said, here are your options.

  1. You can use a Form to capture all that information, and then either create the user manually from that (no coding required), or use the Global Event Hooks to capture the Form Submission, grab that submission's information and programatically set things up (store the file in the Media Library and put the path to it in a Text field for the picture).

  2. Create a custom Form Control that uploads the given file they select to the Media Library, and returns the Url. This way on your Custom Data Table / User Settings, you can have a Text field "FileUrl" and put this custom control there.

Of the two, i would recommend #2.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 7, 2017 17:19

If you go to the Form Controls app and make a slight modification the form control itself, you can then use it in other places. Unfortunately, you can't use a direct upload or file upload with a custom table or system table as they need to have a reference back to an actual page. The other upload controls you can. You can also create your own custom control to do the uploading by copying an existing form control and making a modification to it.

I'd stay away from the media library and uploading files because of the limited security you'd have with a new user or a public user and not being able to restrict it much.

0 votesVote for this answer Mark as a Correct answer

Rasiuddin Khan answered on February 7, 2017 18:22

Dear #Trevor Fayas #Brenden Kehren thank your very much for your suggestion.I know very well all control to mange i have all ready created media library upload file controls and assign URL in text type field. I think better to kentico allow this file type in such case so many complicated job become easy instead of coding and testing need to save time.Its not just to create upload controls using few line code its also matter to check file extension,content type,security proper testing. Thanks again for everyone!!

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on February 7, 2017 19:15 (last edited on February 7, 2017 19:37)

You can have pretty much "out of the box": You don't need to register a user for that. This process has nothing to do with your site registration process. You can use regular forms and you will be fine. On our site we send CV to a specific email address. A user can upload a document and it will be send as an attachment.

Image Text

Image Text

0 votesVote for this answer Mark as a Correct answer

Alicia Zuniga answered on June 1, 2017 23:33

Peter M: I did that on a public facing published form but it does not allow for a user to upload a file from their own computer. It says access is not allowed. Any specific settings you tweaked to allow an external user to use this feature on a form?

Thanks!

Alicia

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.