Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Form Wizard File Upload View modes: 
User avatar
Certified Developer 10
Certified Developer 10
josha-bpstudios - 1/22/2014 3:31:51 PM
   
Form Wizard File Upload
I have a form that loads alternative forms into a wizard. Everything works perfectly except when a file is uploaded, a GUID is created(normal) as well as an entry in the bizformfile folder, but the file itself is always 0kb and has nothing in it. Has anyone else experienced similar behaviors? It seems to be related to the fact that it is in a wizard. In a normal form the form files will upload fine. Also, The wizard is not in an update panel, because when it is, the field doesn't save anything at all.

User avatar
Kentico Support
Kentico Support
kentico_filipl - 1/29/2014 2:18:55 AM
   
RE:Form Wizard File Upload
Hi,

The problem is in Upload control which does not check whether the file has already been uploaded or not before proceeding to the next step.

You could modify ~\CMSFormControls\Basic\UploadControl.ascx.cs file in a following way:
- add this code snippet at the end of OnInit() method:
// check if file not already uploaded
if (String.IsNullOrEmpty(ValidationHelper.GetString(Value, "")))
{
this.Controls.Add(uploader);
}

- globally add
Uploader uploader = new Uploader();

- delete
<cms:Uploader ID="uploader" runat="server" />

from markup (.ascx file)

The only disadvantage is that after you upload the file, button disappears and you cannot change it back but modifying such behavior would require Source code and code adjustments which are delivered as .dll assemblies in standard Kentico CMS projects.

Best regards,
Filip Ligac