Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File and FileReader #296

Merged

Conversation

longo-andrea
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


longo-andrea seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

- **`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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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)`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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()`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `abort`, invocato `abort()`.
- `abort` - invocato `abort()`.

- `progress`, durante la lettura.
- `load`, nessun errore, lettura completata.
- `abort`, invocato `abort()`.
- `error`, si è verificato un errore.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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`),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `readAsDataURL(blob)`, per convertirlo ad url in base64.
- `readAsDataURL(blob)` - per convertirlo ad url in base64.

Copy link
Contributor

@Dorin-David Dorin-David left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Piccole modifiche e suggerimenti

Co-authored-by: Dorin David <70648503+Dorin-David@users.noreply.github.com>
@longo-andrea longo-andrea merged commit c3465bd into javascript-tutorial:master Apr 26, 2021
@javascript-translate-bot

Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants