Atozed Forums
TIWFileUploader not working when named IWFileUploader - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: TIWFileUploader not working when named IWFileUploader (/thread-1296.html)



TIWFileUploader not working when named IWFileUploader - jeroen.rottink - 10-07-2019

Hi,

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.


RE: TIWFileUploader not working when named IWFileUploader - Alexandre Machado - 10-07-2019

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.


RE: TIWFileUploader not working when named IWFileUploader - jeroen.rottink - 10-07-2019

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


Code:
function InitFileUploader() {
  // file uploader (executed after Intraweb js has run to setup page)
  $("#FILEUPLOADER_INPUT").attr("capture","camera");
  $("#FILEUPLOADER_INPUT").attr("accept","image/*");
  $("#FILEUPLOADER_button").attr("class","btn btn-primary btn-block");
}



RE: TIWFileUploader not working when named IWFileUploader - Alexandre Machado - 10-08-2019

Hi,

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"


RE: TIWFileUploader not working when named IWFileUploader - Alexandre Machado - 10-08-2019

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.