From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- files/pt-pt/web/api/file/getastext/index.html | 83 --------------------------- 1 file changed, 83 deletions(-) delete mode 100644 files/pt-pt/web/api/file/getastext/index.html (limited to 'files/pt-pt/web/api/file/getastext/index.html') diff --git a/files/pt-pt/web/api/file/getastext/index.html b/files/pt-pt/web/api/file/getastext/index.html deleted file mode 100644 index b20229737e..0000000000 --- a/files/pt-pt/web/api/file/getastext/index.html +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: File.getAsText() -slug: Web/API/File/getAsText -tags: - - API - - Ficheiros - - File API - - Non-standard - - Obsoleto - - Referencia - - metodo -translation_of: Web/API/File/getAsText ---- -

{{APIRef("File API") }}{{non-standard_header}}

- -

{{obsolete_header(7.0)}}

- -

Sumário

- -

O método getAsText oferece os dados do ficheiro num formato de texto de acordo com uma codificação.

- -
-

Note: Este método está obsoleto; use antes o método {{domxref("FileReader.readAsText()","readAsText()")}} de {{domxref("FileReader")}}.

-
- -

Sintaxe

- -
var str = instanceOfFile.getAsText(encoding);
- -

Parâmetros

- -
-
encoding
-
Uma string a indicar qual a codificação para usar nos dados devolvidos. Se o string estiver vazio, é utilizado UTF-8.
-
- -

Retorna

- -

A string que contem os dados do ficheiro num formato de texto especificado pelo encoding.

- -

Exemplo

- -
// fileInput é um HTMLInputElement: <input type="file" id="myfileinput" multiple>
-var fileInput = document.getElementById("myfileinput");
-
-// files é um objeto de FileList (parecido ao NodeList)
-var files = fileInput.files;
-
-// object com os formatos de media validos
-var accept = {
-  binary : ["image/png", "image/jpeg"],
-  text   : ["text/plain", "text/css", "application/xml", "text/html"]
-};
-
-var file;
-
-for (var i = 0; i < files.length; i++) {
-  file = files[i];
-
-  // se o formato do ficheiro foi detetado
-  if (file !== null) {
-    if (accept.text.indexOf(file.mediaType) > -1) {
-      // file contem texto, num formato permitido
-      // make sure it's encoded as utf-8
-      var data = file.getAsText("utf-8");
-      // modificar dados com métodos de string
-
-    } else if (accept.binary.indexOf(file.mediaType) > -1) {
-      // binario
-    }
-  }
-}
- -

Especificação

- -

Não pertence a nenhuma especificação.

- -

Ver também

- - -- cgit v1.2.3-54-g00ecf