• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Ability to upload files on AutoValidator forms

Jake B.

Well-known member
#1
Title says all, not sure if something like this is already planned for 2.0, but if not it should be done; would make things much easier.
 

Mike

XenForo developer
Staff member
#2
FWIW, the reason we don't do it -- aside from the annoyance of potentially uploading a file multiple times if errors occur -- is that it requires browser support to be done; specifically, < IE 10 doesn't support it. (That said, as I'm writing this, there may be a possible workaround with a hidden iframe but I'd have to look into it further.)
 

Jake B.

Well-known member
#3
aside from the annoyance of potentially uploading a file multiple times if errors occur
Potential workaround for that is to not move the file from the OS temporary directory until after all data checking takes place (including checking that the uploaded file is of a allowed type - zip, png, etc) then moving it to it's "final" location after everything is known to be good. Then if there are errors, they will be displayed and that directory should already automatically cleans itself already iirc

< IE 10 doesn't support it.
That is a bit of a bigger issue though, since it seems that IE 8 and IE 9 still have almost 30% market share on desktop browsers. Sad really.
 

Chris D

XenForo developer
Staff member
#4
As I said to @Mike Creuzer there should be some ability to re-use/copy and amend parts of the AutoInlineUploader code used for the avatar uploading.

The default code auto submits when the file input changes, though, so that may not be totally desirable but certainly that code is a step in the right direction.
 

Jake B.

Well-known member
#5
As I said to @Mike Creuzer there should be some ability to re-use/copy and amend parts of the AutoInlineUploader code used for the avatar uploading.

The default code auto submits when the file input changes, though, so that may not be totally desirable but certainly that code is a step in the right direction.
We actually were going to use that in a modal on the page, however we couldn't get it to close the modal after the upload takes place. Any idea on how to get that functionality working?
 

Chris D

XenForo developer
Staff member
#6
Probably one to continue at the Development Discussions forum.

It should probably just be a case of simulating a click on the overlay closer when you know the upload has finished, e.g.

Code:
$('.OverlayCloser').click();