File and FileReader by longo-andrea · Pull Request #296 · javascript-tutorial/it.javascript.info
| - **`lastModified`** -- the timestamp (integer date) of last modification. | ||
| - **`fileParts`**, è una array di valori di tipo Blob/BufferSource/String. | ||
| - **`fileName`**, il nome del file. | ||
| - **`options`**, oggetto opzionale: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **`options`**, oggetto opzionale: | |
| - **`options`** - oggetto opzionale: |
| - **`fileParts`**, è una array di valori di tipo Blob/BufferSource/String. | ||
| - **`fileName`**, il nome del file. | ||
| - **`options`**, oggetto opzionale: | ||
| - **`lastModified`**, il timestamp dell'ultima modifica (un intero). |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **`lastModified`**, il timestamp dell'ultima modifica (un intero). | |
| - **`lastModified`** - il timestamp dell'ultima modifica (un intero). |
| - `name` -- the file name, | ||
| - `lastModified` -- the timestamp of last modification. | ||
| Poiché `File` eredita da `Blob`, gli oggetti di tipo `File` possiedono le stesse proprietà, con l'aggiunta di: | ||
| - `name`, il nome del file, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `name`, il nome del file, | |
| - `name` - il nome del file, |
| - `name` -- the file name, | ||
| - `lastModified` -- the timestamp of last modification. | ||
| Poiché `File` eredita da `Blob`, gli oggetti di tipo `File` possiedono le stesse proprietà, con l'aggiunta di: | ||
| - `name`, il nome del file, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `name`, il nome del file, | |
| - `name` - il nome del file, |
| - `lastModified` -- the timestamp of last modification. | ||
| Poiché `File` eredita da `Blob`, gli oggetti di tipo `File` possiedono le stesse proprietà, con l'aggiunta di: | ||
| - `name`, il nome del file, | ||
| - `lastModified`, il timestamp dell'ultima modifica. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `lastModified`, il timestamp dell'ultima modifica. | |
| - `lastModified` - il timestamp dell'ultima modifica. |
| - **`readAsText(blob, [encoding])`** -- read the data as a text string with the given encoding (`utf-8` by default). | ||
| - **`readAsDataURL(blob)`** -- read the binary data and encode it as base64 data url. | ||
| - **`abort()`** -- cancel the operation. | ||
| - **`readAsArrayBuffer(blob)`**, legge i dati in formato binario da `ArrayBuffer`. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **`readAsArrayBuffer(blob)`**, legge i dati in formato binario da `ArrayBuffer`. | |
| - **`readAsArrayBuffer(blob)`** - legge i dati in formato binario da `ArrayBuffer`. |
| - **`readAsDataURL(blob)`** -- read the binary data and encode it as base64 data url. | ||
| - **`abort()`** -- cancel the operation. | ||
| - **`readAsArrayBuffer(blob)`**, legge i dati in formato binario da `ArrayBuffer`. | ||
| - **`readAsText(blob, [encoding])`**, legge i dati come stringa di testo con uno specifico encoding (`utf-8` di default). |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **`readAsText(blob, [encoding])`**, legge i dati come stringa di testo con uno specifico encoding (`utf-8` di default). | |
| - **`readAsText(blob, [encoding])`** - legge i dati come stringa di testo con uno specifico encoding (`utf-8` di default). |
| - **`abort()`** -- cancel the operation. | ||
| - **`readAsArrayBuffer(blob)`**, legge i dati in formato binario da `ArrayBuffer`. | ||
| - **`readAsText(blob, [encoding])`**, legge i dati come stringa di testo con uno specifico encoding (`utf-8` di default). | ||
| - **`readAsDataURL(blob)`**, legge i dati in formato binario e li codifica come URL in base64. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **`readAsDataURL(blob)`**, legge i dati in formato binario e li codifica come URL in base64. | |
| - **`readAsDataURL(blob)`** - legge i dati in formato binario e li codifica come URL in base64. |
Comment on lines +60 to 61
| - **`abort()`**, annulla l'operazione. | ||
|
|
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **`abort()`**, annulla l'operazione. | |
| - **`abort()`** - annulla l'operazione. | |
| - `readAsArrayBuffer` -- for binary files, to do low-level binary operations. For high-level operations, like slicing, `File` inherits from `Blob`, so we can call them directly, without reading. | ||
| - `readAsText` -- for text files, when we'd like to get a string. | ||
| - `readAsDataURL` -- when we'd like to use this data in `src` for `img` or another tag. There's an alternative to reading a file for that, as discussed in chapter <info:blob>: `URL.createObjectURL(file)`. | ||
| - `readAsArrayBuffer`, per file di tipo binario, per eseguire operazioni a basso livello. Per operazioni ad alto livello, come la rimozione di porzioni di file, `File` eredita da `Blob`, quindi possiamo invocare i suoi metodi direttamente, senza iniziare la lettura. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `readAsArrayBuffer`, per file di tipo binario, per eseguire operazioni a basso livello. Per operazioni ad alto livello, come la rimozione di porzioni di file, `File` eredita da `Blob`, quindi possiamo invocare i suoi metodi direttamente, senza iniziare la lettura. | |
| - `readAsArrayBuffer` - per file di tipo binario, per eseguire operazioni a basso livello. Per operazioni ad alto livello, come la rimozione di porzioni di file, `File` eredita da `Blob`, quindi possiamo invocare i suoi metodi direttamente, senza iniziare la lettura. |
| - `readAsText` -- for text files, when we'd like to get a string. | ||
| - `readAsDataURL` -- when we'd like to use this data in `src` for `img` or another tag. There's an alternative to reading a file for that, as discussed in chapter <info:blob>: `URL.createObjectURL(file)`. | ||
| - `readAsArrayBuffer`, per file di tipo binario, per eseguire operazioni a basso livello. Per operazioni ad alto livello, come la rimozione di porzioni di file, `File` eredita da `Blob`, quindi possiamo invocare i suoi metodi direttamente, senza iniziare la lettura. | ||
| - `readAsText`, per file di tipo testuale, per ottenerli sotto forma di stringa. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `readAsText`, per file di tipo testuale, per ottenerli sotto forma di stringa. | |
| - `readAsText` - per file di tipo testuale, per ottenerli sotto forma di stringa. |
| - `readAsDataURL` -- when we'd like to use this data in `src` for `img` or another tag. There's an alternative to reading a file for that, as discussed in chapter <info:blob>: `URL.createObjectURL(file)`. | ||
| - `readAsArrayBuffer`, per file di tipo binario, per eseguire operazioni a basso livello. Per operazioni ad alto livello, come la rimozione di porzioni di file, `File` eredita da `Blob`, quindi possiamo invocare i suoi metodi direttamente, senza iniziare la lettura. | ||
| - `readAsText`, per file di tipo testuale, per ottenerli sotto forma di stringa. | ||
| - `readAsDataURL`, quando siamo interessati da utilizzare questi dati come `src` su un `img` o un altro tag. In questo caso c'è un ulteriore alternativa , che abbiamo discusso nel capitolo <info:blob>: `URL.createObjectURL(file)`. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `readAsDataURL`, quando siamo interessati da utilizzare questi dati come `src` su un `img` o un altro tag. In questo caso c'è un ulteriore alternativa , che abbiamo discusso nel capitolo <info:blob>: `URL.createObjectURL(file)`. | |
| - `readAsDataURL` - quando siamo interessati da utilizzare questi dati come `src` su un `img` o un altro tag. In questo caso c'è un ulteriore alternativa , che abbiamo discusso nel capitolo <info:blob>: `URL.createObjectURL(file)`. |
| - `error` -- error has occurred. | ||
| - `loadend` -- reading finished with either success or failure. | ||
| Mentre il processo di lettura prosegue, vengono emessi degli eventi: | ||
| - `loadstart`, la lettura è iniziata. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `loadstart`, la lettura è iniziata. | |
| - `loadstart` - la lettura è iniziata. |
| - `loadend` -- reading finished with either success or failure. | ||
| Mentre il processo di lettura prosegue, vengono emessi degli eventi: | ||
| - `loadstart`, la lettura è iniziata. | ||
| - `progress`, durante la lettura. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `progress`, durante la lettura. | |
| - `progress` - durante la lettura. |
| Mentre il processo di lettura prosegue, vengono emessi degli eventi: | ||
| - `loadstart`, la lettura è iniziata. | ||
| - `progress`, durante la lettura. | ||
| - `load`, nessun errore, lettura completata. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `load`, nessun errore, lettura completata. | |
| - `load` - nessun errore, lettura completata. |
| - `loadstart`, la lettura è iniziata. | ||
| - `progress`, durante la lettura. | ||
| - `load`, nessun errore, lettura completata. | ||
| - `abort`, invocato `abort()`. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `abort`, invocato `abort()`. | |
| - `abort` - invocato `abort()`. |
| - `progress`, durante la lettura. | ||
| - `load`, nessun errore, lettura completata. | ||
| - `abort`, invocato `abort()`. | ||
| - `error`, si è verificato un errore. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `error`, si è verificato un errore. | |
| - `error` - si è verificato un errore. |
| - `load`, nessun errore, lettura completata. | ||
| - `abort`, invocato `abort()`. | ||
| - `error`, si è verificato un errore. | ||
| - `loadend`, lettura completata con o senza errori. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `loadend`, lettura completata con o senza errori. | |
| - `loadend` - lettura completata con o senza errori. |
| - `readAsText(blob, [encoding])` -- to string (an alternative to `TextDecoder`), | ||
| - `readAsDataURL(blob)` -- to base64 data url. | ||
| Possiamo utilizzarlo per convertire un `Blob` in un altro formato: | ||
| - `readAsArrayBuffer(blob)`, per convertirlo ad `ArrayBuffer`, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `readAsArrayBuffer(blob)`, per convertirlo ad `ArrayBuffer`, | |
| - `readAsArrayBuffer(blob)` - per convertirlo ad `ArrayBuffer`, |
| - `readAsDataURL(blob)` -- to base64 data url. | ||
| Possiamo utilizzarlo per convertire un `Blob` in un altro formato: | ||
| - `readAsArrayBuffer(blob)`, per convertirlo ad `ArrayBuffer`, | ||
| - `readAsText(blob, [encoding])`, per convertirlo a string (un'alternativa a `TextDecoder`), |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `readAsText(blob, [encoding])`, per convertirlo a string (un'alternativa a `TextDecoder`), | |
| - `readAsText(blob, [encoding])` - per convertirlo a string (un'alternativa a `TextDecoder`), |
| Possiamo utilizzarlo per convertire un `Blob` in un altro formato: | ||
| - `readAsArrayBuffer(blob)`, per convertirlo ad `ArrayBuffer`, | ||
| - `readAsText(blob, [encoding])`, per convertirlo a string (un'alternativa a `TextDecoder`), | ||
| - `readAsDataURL(blob)`, per convertirlo ad url in base64. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `readAsDataURL(blob)`, per convertirlo ad url in base64. | |
| - `readAsDataURL(blob)` - per convertirlo ad url in base64. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Piccole modifiche e suggerimenti
Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters