Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWFileUploader not working when named IWFileUploader
#1
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.
Reply
#2
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.
Reply
#3
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");
}
Reply
#4
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"
Reply
#5
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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)