rejetto forum

File Mask : Reject forbidden extension before fully uploading the file

0 Members and 1 Guest are viewing this topic.

Offline zeehere

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
Hi,
Using file masks, the uploaded file is checked after it gets fully uploaded. That wastes sometime and bandwidth. (for example uploading a 1GB file and getting rejected after upload)
Is there any way we can reject the forbidden extension file even before the file gets fully uploaded?
PS: I already clearly mentioned allowed file types, but its for those few users who don't read the instructions fully. :)


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
i don't know how to do it, but i'm sure there a way to make a message box saying something before an upload, or have a file check before the upload code.

a more experienced user would be required for setting something up like that.

http://stackoverflow.com/questions/14852090/jquery-check-for-file-extension-before-uploading

Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 842
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
i don't know how to do it, but i'm sure there a way to make a message box saying something before an upload, or have a file check before the upload code.
Yep, using Macros, editing the template. But I agree this should be the default behavior (not allow to fully uploading a file which is forbidden).
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
alternativ add attribute accept to input type='file' in [box upload], e.g. accept='video/*'
« Last Edit: January 08, 2017, 01:32:37 AM by dj »


Offline zeehere

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
alternativ add attribute accept to input type='file' in [box upload], e.g. accept='video/*'
Thanks for the tip. I tried this, but it does not seem to work.
<input type='file' accept='.xls,.xlsx' />
It can still accept any file.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
it could technically be done with some extra code in the template.
i will add it to the to-do list