CVS log for loncom/javascriptlib/file_upload.js

[BACK] Up to [LON-CAPA] / loncom / javascriptlib

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.4: download - view: text, markup, annotated - select for diffs
Tue Jul 11 22:24:30 2023 UTC (16 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_12_X, version_2_11_X, version_2_11_5_msu, version_2_11_5, version_2_11_4_msu, HEAD
Diff to previous 1.3: preferred, colored
Changes since revision 1.3: +13 -1 lines
- Satisfy w3c HTML validation: id attributes must be unique.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Aug 11 14:16:55 2019 UTC (5 years, 3 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_11_4_uiuc, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3
Diff to previous 1.2: preferred, colored
Changes since revision 1.2: +74 -17 lines
- Client-side checking for uploaded file size.
 - File size checks in multi-part problems supported where different size
   limits potentially apply to essayresponse items in the different parts.
 - File size checks supported in essayresponse item(s) in composite pages.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed Aug 7 16:08:17 2019 UTC (5 years, 3 months ago) by raeburn
Branches: MAIN
Diff to previous 1.1: preferred, colored
Changes since revision 1.1: +6 -6 lines
- Prepend LC_ to class name in client-side checking for uploaded file size,
  for purposes of namespacing.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Thu Jun 18 20:19:18 2015 UTC (9 years, 4 months ago) by musolffc
Branches: MAIN
File size checking for uploaded files

A new javascript file, file_upload.js, handles client side file size checking.
The function, checkUploadSize(), accepts an html file input element and a maximum
file size (in bytes) as input.  If the size of the file to be uploaded exceeds the
size allowed, a message is displayed the the element is cleared.  Server side
checking is still used if it passes this test.

Loading file_upload.js adds event handlers to file input elements with
class="flUpload".
    <input type="file" class="flUpload" />

It also looks for a hidden element with id="free_space" that contains the maximum
upload size.
    <input type="hidden" id="free_space" value="$free_space" />

The free space is usually calculated by subtracting a user's disk usage from their
quota allowance.  In some cases it is a fixed value.

I have implemented this for every upload instance I could find.  These include:
* Message attachments
* Authoring space
* Portfolio
* Course editor
* Essay response problems
* Helpdesk request forms
* RSS feed uploads

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>