Atozed Forums

Full Version: TIWFileUploader not working when named IWFileUploader
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

In a project compiled with IW15.0.18 I used a TIWFileUploader component named IWFileUploader. This was working fine.
I now recompiled that project with IW15.0.23 and see the event OnAsyncUploadCompleted is not called.

When I rename the component to IWFileUploader1 or Uploader it works fine again.

Did something change in parsing the query string parameters between .18 and .23?

You can check by compiling demos\IWFileUploaderDB and renaming the component.
IWFileUploader is a required field when uploading a file thus it shouldn't be used as a component name. Although HTTP doesn't forbid it and IW can possibly distinguish them based on some criteria other than the name, I strongly recommend you to use another name for the control.
Hi Alexandre,

Will do that. Small other question related to TIWFileUploader.AcceptFiles:

According to the documentation:

Quote:When true, will accept files for upload

Default value: True

Is the documentation wrong here?

I want to set it to "image/*". This is not possible. It's changed to ".image/*".
To get the same effect I use some javascript

function InitFileUploader() {
  // file uploader (executed after Intraweb js has run to setup page)
  $("#FILEUPLOADER_button").attr("class","btn btn-primary btn-block");

yes, I'm afraid docs are wrong regarding this property.

AcceptFiles is a comma-separated list of strings, each one representing one type of file. It is analogous to the "accept" attribute of <input> elements with type="file"

Example: "image/png, image/jpeg"
Regarding the DOT '.' in front of types, I'm also afraid that is is a bug. It was supposed to add a dot in front of valid file extensions, but in case of image/*, video/* and audio/*, the dot shouldn't be included otherwise the browser will treat it as a file extension and not a file type.

It will be fixed in the next release.