diff --git a/doc/de/index.md b/doc/de/index.md index 4311761..429911e 100644 --- a/doc/de/index.md +++ b/doc/de/index.md @@ -21,6 +21,16 @@ Dieses Plugin ermöglicht Ihnen zum Hochladen und Herunterladen von Dateien. +Dieses Plugin wird global `FileTransfer`, `FileUploadOptions` Konstruktoren definiert. + +Obwohl im globalen Gültigkeitsbereich, sind sie nicht bis nach dem `deviceready`-Ereignis. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(FileTransfer); + } + + ## Installation cordova plugin add org.apache.cordova.file-transfer @@ -31,21 +41,20 @@ Dieses Plugin ermöglicht Ihnen zum Hochladen und Herunterladen von Dateien. * Amazon Fire OS * Android * BlackBerry 10 +* Browser * Firefox OS ** * iOS * Windows Phone 7 und 8 * -* Windows 8 ***| -* Windows ***| +* Windows 8 +* Windows -* *Unterstützen nicht `onprogress` noch `abort()` * +* *Unterstützen keine `onprogress` noch `abort()`* -** *Unterstützen keine `onprogress` * - -Partielle Unterstützung von `onprogress` für upload-Methode. `onprogress` wird aufgerufen, mit leeren Progress-Ereignis durch Windows Limitations_ +* * *`onprogress` nicht unterstützt* # FileTransfer -Das `FileTransfer` Objekt bietet eine Möglichkeit zum Hochladen von Dateien, die mithilfe einer HTTP-Anforderung für mehrteiligen POST sowie Informationen zum Herunterladen von Dateien sowie. +Das `FileTransfer`-Objekt bietet eine Möglichkeit zum Hochladen von Dateien, die mithilfe einer HTTP-Anforderung für mehrteiligen POST sowie Informationen zum Herunterladen von Dateien sowie. ## Eigenschaften @@ -57,7 +66,7 @@ Das `FileTransfer` Objekt bietet eine Möglichkeit zum Hochladen von Dateien, di * **Download**: lädt eine Datei vom Server. -* **Abbrechen**: Abbruch eine Übertragung in Bearbeitung. +* **abort**: Abbruch eine Übertragung in Bearbeitung. ## Upload @@ -67,18 +76,19 @@ Das `FileTransfer` Objekt bietet eine Möglichkeit zum Hochladen von Dateien, di * **Server**: URL des Servers, die Datei zu empfangen, wie kodiert`encodeURI()`. -* **SuccessCallback**: ein Rückruf, der übergeben wird ein `Metadata` Objekt. *(Funktion)* +* **successCallback**: ein Rückruf, der ein `FileUploadResult`-Objekt übergeben wird. *(Funktion)* -* **ErrorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `Metadata` . Aufgerufene mit einem `FileTransferError` Objekt. *(Funktion)* +* **errorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `FileUploadResult`. Mit einem `FileTransferError`-Objekt aufgerufen. *(Funktion)* * **Optionen**: optionale Parameter *(Objekt)*. Gültige Schlüssel: * **FileKey**: der Name des Form-Elements. Wird standardmäßig auf `file` . (DOM-String und enthält) * **Dateiname**: der Dateiname beim Speichern der Datei auf dem Server verwendet. Wird standardmäßig auf `image.jpg` . (DOM-String und enthält) - * **MimeType**: den Mime-Typ der Daten hochzuladen. Wird standardmäßig auf `image/jpeg` . (DOM-String und enthält) - * **Params**: eine Reihe von optionalen Schlüssel/Wert-Paaren in der HTTP-Anforderung übergeben. (Objekt) - * **ChunkedMode**: ob die Daten in "Chunked" streaming-Modus hochladen. Wird standardmäßig auf `true` . (Boolean) - * **Header**: eine Karte von Header-Name-Header-Werte. Verwenden Sie ein Array, um mehr als einen Wert anzugeben. (Objekt) + * **httpMethod**: die HTTP-Methode, die-entweder `PUT` oder `POST`. Der Standardwert ist `POST`. (DOM-String und enthält) + * **mimeType**: den Mime-Typ der Daten hochzuladen. Standardwerte auf `Image/Jpeg`. (DOM-String und enthält) + * **params**: eine Reihe von optionalen Schlüssel/Wert-Paaren in der HTTP-Anforderung übergeben. (Objekt) + * **chunkedMode**: ob die Daten in "Chunked" streaming-Modus hochladen. Der Standardwert ist `true`. (Boolean) + * **headers**: eine Karte von Header-Name-Header-Werte. Verwenden Sie ein Array, um mehr als einen Wert anzugeben. (Objekt) * **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)* @@ -152,7 +162,7 @@ Das `FileTransfer` Objekt bietet eine Möglichkeit zum Hochladen von Dateien, di ## FileUploadResult -A `FileUploadResult` -Objekt wird an den Erfolg-Rückruf des übergeben die `FileTransfer` des Objekts `upload()` Methode. +Ein `FileUploadResult`-Objekt wird an den Erfolg-Rückruf des `Objekts FileTransfer`-Upload()-Methode übergeben. ### Eigenschaften @@ -160,7 +170,7 @@ A `FileUploadResult` -Objekt wird an den Erfolg-Rückruf des übergeben die `Fil * **ResponseCode**: die HTTP-Response-Code vom Server zurückgegeben. (lange) -* **Antwort**: der HTTP-Antwort vom Server zurückgegeben. (DOM-String und enthält) +* **response**: der HTTP-Antwort vom Server zurückgegeben. (DOM-String und enthält) * **Header**: die HTTP-Response-Header vom Server. (Objekt) @@ -174,17 +184,17 @@ A `FileUploadResult` -Objekt wird an den Erfolg-Rückruf des übergeben die `Fil **Parameter**: -* **Quelle**: URL des Servers, um die Datei herunterzuladen, wie kodiert`encodeURI()`. +* **source**: URL des Servers, um die Datei herunterzuladen, wie kodiert`encodeURI()`. -* **Ziel**: Dateisystem-Url, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten) +* **target**: Dateisystem-Url, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten) * **SuccessCallback**: ein Rückruf, der übergeben wird ein `FileEntry` Objekt. *(Funktion)* -* **ErrorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `Metadata` . Aufgerufene mit einem `FileTransferError` Objekt. *(Funktion)* +* **errorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `FileEntry`. Mit einem `FileTransferError`-Objekt aufgerufen. *(Funktion)* * **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)* -* **Optionen**: optionale Parameter, derzeit nur unterstützt Kopfzeilen (z. B. Autorisierung (Standardauthentifizierung), etc.). +* **Options**: optionale Parameter, derzeit nur unterstützt Kopfzeilen (z. B. Autorisierung (Standardauthentifizierung), etc.). ### Beispiel @@ -214,7 +224,7 @@ A `FileUploadResult` -Objekt wird an den Erfolg-Rückruf des übergeben die `Fil ); -## Abbruch +## abort Bricht einen in-Progress-Transfer. Der Onerror-Rückruf wird ein FileTransferError-Objekt übergeben, die einen Fehlercode FileTransferError.ABORT_ERR hat. @@ -246,7 +256,7 @@ Bricht einen in-Progress-Transfer. Der Onerror-Rückruf wird ein FileTransferErr ## FileTransferError -A `FileTransferError` Objekt wird an eine Fehler-Callback übergeben, wenn ein Fehler auftritt. +Ein `FileTransferError`-Objekt wird an eine Fehler-Callback übergeben, wenn ein Fehler auftritt. ### Eigenschaften @@ -258,7 +268,9 @@ A `FileTransferError` Objekt wird an eine Fehler-Callback übergeben, wenn ein F * **HTTP_STATUS**: HTTP-Statuscode. Dieses Attribut ist nur verfügbar, wenn ein Response-Code aus der HTTP-Verbindung eingeht. (Anzahl) -* **Ausnahme**: entweder e.getMessage oder e.toString (String) +* **body** Antworttext. Dieses Attribut ist nur verfügbar, wenn eine Antwort von der HTTP-Verbindung eingeht. (String) + +* **exception**: entweder e.getMessage oder e.toString (String) ### Konstanten @@ -278,13 +290,13 @@ Frühere Versionen des Plugins würde nur Gerät-Absolute-Dateipfade als Quelle Für rückwärts Kompatibilität, diese Pfade noch akzeptiert werden, und wenn Ihre Anwendung Pfade wie diese im permanenten Speicher aufgezeichnet hat, dann sie können weiter verwendet werden. -Diese Pfade waren zuvor ausgesetzt, der `fullPath` -Eigenschaft des `FileEntry` und `DirectoryEntry` Objekte, die durch das Plugin Datei zurückgegeben. Neue Versionen der die Datei-Erweiterung, jedoch nicht länger werden diese Pfade zu JavaScript. +Diese Pfade waren zuvor in der Eigenschaft `fullPath` `FileEntry` und `DirectoryEntry`-Objekte, die durch das Plugin Datei zurückgegeben ausgesetzt. Neue Versionen der die Datei-Erweiterung, jedoch nicht länger werden diese Pfade zu JavaScript. -Wenn Sie ein auf eine neue Upgrade (1.0.0 oder neuere) Version der Datei und Sie zuvor verwendet haben `entry.fullPath` als Argumente für `download()` oder `upload()` , dann du den Code musst, um die Dateisystem-URLs verwenden zu ändern. +Wenn Sie ein auf eine neue Upgrade (1.0.0 oder neuere) Version der Datei, und Sie haben zuvor mit `entry.fullPath` als Argumente `download()` oder `upload()`, dann ändern Sie den Code, um die Dateisystem-URLs verwenden müssen. -`FileEntry.toURL()`und `DirectoryEntry.toURL()` zurück, eine Dateisystem-URL in der Form +`FileEntry.toURL()` und `DirectoryEntry.toURL()` zurück, eine Dateisystem-URL in der form cdvfile://localhost/persistent/path/to/file -die benutzt werden kann, anstelle der absoluten Dateipfad in beiden `download()` und `upload()` Methoden. \ No newline at end of file +die anstelle der absoluten Dateipfad in `download()` und `upload()` Methode verwendet werden kann. \ No newline at end of file diff --git a/doc/es/index.md b/doc/es/index.md index d8ef0b4..baa5fa3 100644 --- a/doc/es/index.md +++ b/doc/es/index.md @@ -21,9 +21,17 @@ Este plugin te permite cargar y descargar archivos. +Este plugin define global `FileTransfer` , `FileUploadOptions` constructores. + +Aunque en el ámbito global, no están disponibles hasta después de la `deviceready` evento. + + document.addEventListener ("deviceready", onDeviceReady, false); + function onDeviceReady() {console.log(FileTransfer)}; + + ## Instalación - cordova plugin add org.apache.cordova.file-transfer + Cordova plugin añade org.apache.cordova.file-transferencia ## Plataformas soportadas @@ -31,18 +39,17 @@ Este plugin te permite cargar y descargar archivos. * Amazon fire OS * Android * BlackBerry 10 +* Explorador * Firefox OS ** * iOS * Windows Phone 7 y 8 * -* Windows 8 ***| -* Windows ***| +* Windows 8 +* Windows * *No son compatibles con `onprogress` ni `abort()` * ** *No son compatibles con `onprogress` * -Apoyo parcial de `onprogress` para subir método `onprogress` se llama con el evento progress vacía debido a Windows limitations_ - # FileTransfer El `FileTransfer` objeto proporciona una manera de subir archivos mediante una solicitud HTTP de POST varias parte y para descargar archivos. @@ -67,14 +74,15 @@ El `FileTransfer` objeto proporciona una manera de subir archivos mediante una s * **servidor**: dirección URL del servidor para recibir el archivo, como codificada por`encodeURI()`. -* **successCallback**: una devolución de llamada que se pasa un `Metadata` objeto. *(Función)* +* **successCallback**: una devolución de llamada que se pasa un `FileUploadResult` objeto. *(Función)* -* **errorCallback**: una devolución de llamada que se ejecuta si se produce un error recuperar la `Metadata` . Invocado con un `FileTransferError` objeto. *(Función)* +* **errorCallback**: una devolución de llamada que se ejecuta si se produce un error recuperar la `FileUploadResult` . Invocado con un `FileTransferError` objeto. *(Función)* * **Opciones**: parámetros opcionales *(objeto)*. Teclas válidas: * **fileKey**: el nombre del elemento de formulario. Por defecto es `file` . (DOMString) * **nombre de archivo**: el nombre del archivo a utilizar al guardar el archivo en el servidor. Por defecto es `image.jpg` . (DOMString) + * **httpMethod**: método HTTP el utilizar - o `PUT` o `POST` . Por defecto es `POST` . (DOMString) * **mimeType**: el tipo mime de los datos para cargar. Por defecto es `image/jpeg` . (DOMString) * **params**: un conjunto de pares clave/valor opcional para pasar en la petición HTTP. (Objeto) * **chunkedMode**: Si desea cargar los datos en modo de transmisión fragmentado. Por defecto es `true` . (Boolean) @@ -84,70 +92,56 @@ El `FileTransfer` objeto proporciona una manera de subir archivos mediante una s ### Ejemplo - // !! Assumes variable fileURL contains a valid URL to a text file on the device, - // for example, cdvfile://localhost/persistent/path/to/file.txt + // !! Asume fileURL variable contiene una dirección URL válida a un archivo de texto en el dispositivo, / / por ejemplo, ganar var cdvfile://localhost/persistent/path/to/file.txt = function (r) {console.log ("código =" + r.responseCode); + Console.log ("respuesta =" + r.response); + Console.log ("Sent =" + r.bytesSent);} - var win = function (r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - } + var fallar = function (error) {alert ("ha ocurrido un error: código =" + error.code); + Console.log ("error al cargar el origen" + error.source); + Console.log ("upload error objetivo" + error.target);} - var fail = function (error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } - - var options = new FileUploadOptions(); + var opciones = new FileUploadOptions(); options.fileKey = "file"; options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1); options.mimeType = "text/plain"; var params = {}; - params.value1 = "test"; + params.value1 = "prueba"; params.value2 = "param"; options.params = params; var ft = new FileTransfer(); - ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options); + Ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, opciones); ### Ejemplo con cabeceras de subir y eventos de progreso (Android y iOS solamente) - function win(r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - } + function win(r) {console.log ("código =" + r.responseCode); + Console.log ("respuesta =" + r.response); + Console.log ("Sent =" + r.bytesSent);} - function fail(error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } + function fail(error) {alert ("ha ocurrido un error: código =" + error.code); + Console.log ("error al cargar el origen" + error.source); + Console.log ("upload error objetivo" + error.target);} - var uri = encodeURI("http://some.server.com/upload.php"); + var uri = encodeURI ("http://some.server.com/upload.php"); - var options = new FileUploadOptions(); + var opciones = new FileUploadOptions(); options.fileKey="file"; options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1); options.mimeType="text/plain"; - var headers={'headerParam':'headerValue'}; + cabeceras de var ={'headerParam':'headerValue'}; - options.headers = headers; + options.headers = encabezados; var ft = new FileTransfer(); - ft.onprogress = function(progressEvent) { - if (progressEvent.lengthComputable) { - loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total); - } else { - loadingStatus.increment(); + Ft.OnProgress = function(progressEvent) {si (progressEvent.lengthComputable) {loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total); + } {loadingStatus.increment() más; } }; - ft.upload(fileURL, uri, win, fail, options); + Ft.upload (fileURL, uri, win, fail, opciones); ## FileUploadResult @@ -180,7 +174,7 @@ A `FileUploadResult` objeto se pasa a la devolución del éxito de la `FileTrans * **successCallback**: una devolución de llamada que se pasa un `FileEntry` objeto. *(Función)* -* **errorCallback**: una devolución de llamada que se ejecuta si se produce un error al recuperar los `Metadata` . Invocado con un `FileTransferError` objeto. *(Función)* +* **errorCallback**: una devolución de llamada que se ejecuta si se produce un error al recuperar los `FileEntry` . Invocado con un `FileTransferError` objeto. *(Función)* * **trustAllHosts**: parámetro opcional, por defecto es `false` . Si establece en `true` , acepta todos los certificados de seguridad. Esto es útil porque Android rechaza certificados autofirmados seguridad. No se recomienda para uso productivo. Compatible con iOS y Android. *(boolean)* @@ -188,30 +182,14 @@ A `FileUploadResult` objeto se pasa a la devolución del éxito de la `FileTrans ### Ejemplo - // !! Assumes variable fileURL contains a valid URL to a path on the device, - // for example, cdvfile://localhost/persistent/path/to/downloads/ + // !! Asume fileURL variable contiene una dirección URL válida a un camino en el dispositivo, / / por ejemplo, File Transfer var cdvfile://localhost/persistent/path/to/downloads/ = new FileTransfer(); + var uri = encodeURI ("http://some.server.com/download.php"); - var fileTransfer = new FileTransfer(); - var uri = encodeURI("http://some.server.com/download.php"); - - fileTransfer.download( - uri, - fileURL, - function(entry) { - console.log("download complete: " + entry.toURL()); - }, - function(error) { - console.log("download error source " + error.source); - console.log("download error target " + error.target); - console.log("upload error code" + error.code); - }, - false, - { - headers: { - "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" - } - } - ); + fileTransfer.download (uri, fileURL, function(entry) {console.log ("descarga completa:" + entry.toURL()); + }, function(error) {console.log ("error al descargar el origen" + error.source); + Console.log ("descargar error objetivo" + error.target); + Console.log ("código de error de carga" + error.code); + }, falso, {encabezados: {"Autorización": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA =="}}); ## abortar @@ -220,28 +198,20 @@ Aborta a una transferencia en curso. El callback onerror se pasa un objeto FileT ### Ejemplo - // !! Assumes variable fileURL contains a valid URL to a text file on the device, - // for example, cdvfile://localhost/persistent/path/to/file.txt + // !! Asume fileURL variable contiene una dirección URL válida a un archivo de texto en el dispositivo, / / por ejemplo, ganar cdvfile://localhost/persistent/path/to/file.txt var function(r) = {console.log ("no se debe llamar.");} - var win = function(r) { - console.log("Should not be called."); - } + var fallar = function(error) {/ / error.code == FileTransferError.ABORT_ERR alert ("ha ocurrido un error: código =" + error.code); + Console.log ("error al cargar el origen" + error.source); + Console.log ("upload error objetivo" + error.target);} - var fail = function(error) { - // error.code == FileTransferError.ABORT_ERR - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } - - var options = new FileUploadOptions(); + var opciones = new FileUploadOptions(); options.fileKey="file"; options.fileName="myphoto.jpg"; options.mimeType="image/jpeg"; var ft = new FileTransfer(); - ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options); - ft.abort(); + Ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, opciones); + Ft.Abort(); ## FileTransferError @@ -258,6 +228,8 @@ A `FileTransferError` objeto se pasa a un callback de error cuando se produce un * **HTTP_STATUS**: código de estado HTTP. Este atributo sólo está disponible cuando se recibe un código de respuesta de la conexión HTTP. (Número) +* **cuerpo** Cuerpo de la respuesta. Este atributo sólo está disponible cuando se recibe una respuesta de la conexión HTTP. (String) + * **excepción**: cualquier e.getMessage o e.toString (String) ### Constantes diff --git a/doc/fr/index.md b/doc/fr/index.md index 6144648..078f7c1 100644 --- a/doc/fr/index.md +++ b/doc/fr/index.md @@ -21,9 +21,17 @@ Ce plugin vous permet de télécharger des fichiers. +Ce plugin définit global `FileTransfer` , `FileUploadOptions` constructeurs. + +Bien que dans la portée globale, ils ne sont pas disponibles jusqu'après la `deviceready` événement. + + document.addEventListener (« deviceready », onDeviceReady, false) ; + function onDeviceReady() {console.log(FileTransfer);} + + ## Installation - cordova plugin add org.apache.cordova.file-transfer + Cordova plugin ajouter org.apache.cordova.file-transfert ## Plates-formes prises en charge @@ -31,18 +39,17 @@ Ce plugin vous permet de télécharger des fichiers. * Amazon Fire OS * Android * BlackBerry 10 +* Navigateur * Firefox OS ** * iOS * Windows Phone 7 et 8 * -* Windows 8 ***| -* Windows ***| +* Windows 8 +* Windows * *Ne supportent pas `onprogress` ni `abort()` * ** *Ne prennent pas en charge `onprogress` * -Prise en charge partielle des `onprogress` pour télécharger méthode. `onprogress` est appelée avec l'événement de progression vide à cause de Windows limitations_ - # Transfert de fichiers Le `FileTransfer` objet fournit un moyen de télécharger des fichiers à l'aide d'une requête HTTP de la poste plusieurs partie et pour télécharger des fichiers aussi bien. @@ -67,14 +74,15 @@ Le `FileTransfer` objet fournit un moyen de télécharger des fichiers à l'aide * **server** : l'URL du serveur destiné à recevoir le fichier, encodée via `encodeURI()`. -* **successCallback**: un callback passé à un objet `Metadata`. *(Fonction)* +* **successCallback**: un rappel passé un `FileUploadResult` objet. *(Fonction)* -* **errorCallback** : callback d'erreur s'exécutant si une erreur survient lors de la récupération de l'objet `Metadata` . Appelée avec un objet `FileTransferError`. *(Function)* +* **errorCallback**: un rappel qui s'exécute si une erreur survient récupérer la `FileUploadResult` . Appelée avec un `FileTransferError` objet. *(Fonction)* * **options**: paramètres facultatifs *(objet)*. Clés valides : * **fileKey**: le nom de l'élément form. Valeur par défaut est `file` . (DOMString) * **fileName**: le nom de fichier à utiliser lorsque vous enregistrez le fichier sur le serveur. Valeur par défaut est `image.jpg` . (DOMString) + * **httpMethod**: méthode de The HTTP à utiliser - soit `PUT` ou `POST` . Valeur par défaut est `POST` . (DOMString) * **type MIME**: le type mime des données à télécharger. Valeur par défaut est `image/jpeg` . (DOMString) * **params**: un ensemble de paires clé/valeur facultative pour passer dans la requête HTTP. (Objet) * **chunkedMode**: s'il faut télécharger les données en mode streaming mémorisé en bloc. Valeur par défaut est `true` . (Boolean) @@ -84,70 +92,56 @@ Le `FileTransfer` objet fournit un moyen de télécharger des fichiers à l'aide ### Exemple - // !! Assumes variable fileURL contains a valid URL to a text file on the device, - // for example, cdvfile://localhost/persistent/path/to/file.txt + // !! Suppose fileURL variable contient une URL valide dans un fichier texte sur le périphérique, / / par exemple, cdvfile://localhost/persistent/path/to/file.txt var win = function (r) {console.log ("Code =" + r.responseCode) ; + Console.log ("réponse =" + r.response) ; + Console.log ("envoyés =" + r.bytesSent);} - var win = function (r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - } + échouer var = function (erreur) {alert ("une erreur est survenue : Code =" + error.code) ; + Console.log (« source de l'erreur de téléchargement » + error.source) ; + Console.log ("erreur de téléchargement cible" + error.target);} - var fail = function (error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } + options de var = new FileUploadOptions() ; + options.fileKey = « fichier » ; + options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1) ; + options.mimeType = « text/plain » ; - var options = new FileUploadOptions(); - options.fileKey = "file"; - options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1); - options.mimeType = "text/plain"; + var params = {} ; + params.value1 = « test » ; + params.Value2 = « param » ; - var params = {}; - params.value1 = "test"; - params.value2 = "param"; + options.params = params ; - options.params = params; - - var ft = new FileTransfer(); - ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options); + ft var = new FileTransfer() ; + ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, options) ; ### Exemple avec téléchargement du Header et des Progress Events (Android et iOS uniquement) - function win(r) { - console.log("Code = " + r.responseCode); - console.log("Response = " + r.response); - console.log("Sent = " + r.bytesSent); - } + function win(r) {console.log ("Code =" + r.responseCode) ; + Console.log ("réponse =" + r.response) ; + Console.log ("envoyés =" + r.bytesSent);} - function fail(error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } + function fail(error) {alert ("une erreur est survenue : Code =" + error.code) ; + Console.log (« source de l'erreur de téléchargement » + error.source) ; + Console.log ("erreur de téléchargement cible" + error.target);} - var uri = encodeURI("http://some.server.com/upload.php"); + var uri = encodeURI ("http://some.server.com/upload.php") ; - var options = new FileUploadOptions(); - options.fileKey="file"; - options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1); - options.mimeType="text/plain"; + options de var = new FileUploadOptions() ; + options.fileKey="file" ; + options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1) ; + options.mimeType="text/plain" ; - var headers={'headerParam':'headerValue'}; + en-têtes var ={'headerParam':'headerValue'} ; - options.headers = headers; + options.Headers = en-têtes ; - var ft = new FileTransfer(); - ft.onprogress = function(progressEvent) { - if (progressEvent.lengthComputable) { - loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total); - } else { - loadingStatus.increment(); + ft var = new FileTransfer() ; + ft.OnProgress = function(progressEvent) {si (progressEvent.lengthComputable) {loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total) ; + } else {loadingStatus.increment() ; } }; - ft.upload(fileURL, uri, win, fail, options); + ft.upload (fileURL, uri, win, fail, options) ; ## FileUploadResult @@ -180,7 +174,7 @@ A `FileUploadResult` objet est passé au rappel de succès la `FileTransfer` de * **successCallback** : une callback de succès à laquelle est passée un objet `FileEntry`. *(Function)* -* **errorCallback** : une callback d'erreur s'exécutant si une erreur se produit lors de la récupération de l'objet `Metadata`. Appelée avec un objet `FileTransferError`. *(Function)* +* **errorCallback**: un rappel qui s'exécute si une erreur se produit lors de la récupération du `FileEntry` . Appelée avec un `FileTransferError` objet. *(Fonction)* * **trustAllHosts**: paramètre facultatif, valeur par défaut est `false` . Si la valeur est `true` , il accepte tous les certificats de sécurité. Ceci peut être utile car Android rejette les certificats auto-signés. N'est pas recommandé pour une utilisation en production. Supporté sur Android et iOS. *(booléen)* @@ -188,30 +182,14 @@ A `FileUploadResult` objet est passé au rappel de succès la `FileTransfer` de ### Exemple - // !! Assumes variable fileURL contains a valid URL to a path on the device, - // for example, cdvfile://localhost/persistent/path/to/downloads/ + // !! Suppose fileURL variable contient une URL valide vers un chemin d'accès sur le périphérique, / / par exemple, transfert de fichiers var cdvfile://localhost/persistent/path/to/downloads/ = new FileTransfer() ; + var uri = encodeURI ("http://some.server.com/download.php") ; - var fileTransfer = new FileTransfer(); - var uri = encodeURI("http://some.server.com/download.php"); - - fileTransfer.download( - uri, - fileURL, - function(entry) { - console.log("download complete: " + entry.toURL()); - }, - function(error) { - console.log("download error source " + error.source); - console.log("download error target " + error.target); - console.log("upload error code" + error.code); - }, - false, - { - headers: { - "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" - } - } - ); + fileTransfer.download (uri, fileURL, function(entry) {console.log ("téléchargement complet:" + entry.toURL()) ; + }, function(error) {console.log (« source de l'erreur de téléchargement » + error.source) ; + Console.log (« erreur de téléchargement cible » + error.target) ; + Console.log (« code d'erreur de téléchargement » + error.code) ; + }, faux, {en-têtes: {« Autorisation »: « dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA base == "}}) ; ## abort @@ -220,28 +198,20 @@ Abandonne un transfert en cours. Le rappel onerror est passé à un objet FileTr ### Exemple - // !! Assumes variable fileURL contains a valid URL to a text file on the device, - // for example, cdvfile://localhost/persistent/path/to/file.txt + // !! Suppose fileURL variable contient une URL valide dans un fichier texte sur le périphérique, / / par exemple, cdvfile://localhost/persistent/path/to/file.txt var win = function(r) {console.log ("ne devrait pas être appelée.");} - var win = function(r) { - console.log("Should not be called."); - } + var fail = function(error) {/ / error.code == FileTransferError.ABORT_ERR alert ("une erreur est survenue : Code =" + error.code) ; + Console.log (« source de l'erreur de téléchargement » + error.source) ; + Console.log ("erreur de téléchargement cible" + error.target);} - var fail = function(error) { - // error.code == FileTransferError.ABORT_ERR - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } + options de var = new FileUploadOptions() ; + options.fileKey="file" ; + options.fileName="myphoto.jpg" ; + options.mimeType="image/jpeg" ; - var options = new FileUploadOptions(); - options.fileKey="file"; - options.fileName="myphoto.jpg"; - options.mimeType="image/jpeg"; - - var ft = new FileTransfer(); - ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options); - ft.abort(); + ft var = new FileTransfer() ; + ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, options) ; + ft.Abort() ; ## FileTransferError @@ -258,6 +228,8 @@ A `FileTransferError` objet est passé à un rappel d'erreur lorsqu'une erreur s * **http_status** : code d'état HTTP. Cet attribut n'est disponible que lorsqu'un code de réponse est fourni via la connexion HTTP. (Number) +* **corps** Corps de réponse. Cet attribut n'est disponible que lorsqu'une réponse est reçue de la connexion HTTP. (String) + * **exception**: soit e.getMessage ou e.toString (String) ### Constantes @@ -272,8 +244,7 @@ A `FileTransferError` objet est passé à un rappel d'erreur lorsqu'une erreur s Les versions précédentes de ce plugin n'accepterait périphérique--fichier-chemins d'accès absolus comme source pour les téléchargements, ou comme cible pour les téléchargements. Ces chemins seraient généralement de la forme - /var/mobile/Applications//Documents/path/to/file (iOS) - /storage/emulated/0/path/to/file (Android) + / var/mobile/Applications/< application UUID >/Documents/chemin/vers/fichier (iOS), /storage/emulated/0/path/to/file (Android) Pour vers l'arrière la compatibilité, ces chemins sont toujours acceptés, et si votre application a enregistré des chemins comme celles-ci dans un stockage persistant, alors ils peuvent continuer à être utilisé. diff --git a/doc/it/index.md b/doc/it/index.md index dbd2625..f22ad80 100644 --- a/doc/it/index.md +++ b/doc/it/index.md @@ -21,6 +21,16 @@ Questo plugin permette di caricare e scaricare file. +Questo plugin definisce globale `FileTransfer`, costruttori di `FileUploadOptions`. + +Anche se in ambito globale, non sono disponibili fino a dopo l'evento `deviceready`. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(FileTransfer); + } + + ## Installazione cordova plugin add org.apache.cordova.file-transfer @@ -31,21 +41,20 @@ Questo plugin permette di caricare e scaricare file. * Amazon fuoco OS * Android * BlackBerry 10 -* Firefox OS * * +* Browser +* Firefox OS** * iOS * Windows Phone 7 e 8 * -* Windows 8 * * *| -* Windows * * *| +* Windows 8 +* Windows -* *Non supportano `onprogress` né `abort()` * +* *Supporto `onprogress` né `abort()`* -* * *Non supportano `onprogress` * - -Supporto parziale di `onprogress` per caricare metodo. `onprogress` viene chiamato con evento progress vuota a causa di Windows limitations_ +** *Non supportano `onprogress`* # FileTransfer -Il `FileTransfer` oggetto fornisce un modo per caricare i file utilizzando una richiesta HTTP di POST più parte e scaricare file pure. +L'oggetto `FileTransfer` fornisce un modo per caricare i file utilizzando una richiesta HTTP di POST più parte e scaricare file pure. ## Proprietà @@ -67,18 +76,19 @@ Il `FileTransfer` oggetto fornisce un modo per caricare i file utilizzando una r * **server**: URL del server per ricevere il file, come codificato dal`encodeURI()`. -* **successCallback**: un callback passato un `Metadata` oggetto. *(Funzione)* +* **successCallback**: un callback che viene passato un oggetto `FileUploadResult`. *(Funzione)* -* **errorCallback**: un callback che viene eseguito se si verifica un errore recuperando il `Metadata` . Invocato con un `FileTransferError` oggetto. *(Funzione)* +* **errorCallback**: un callback che viene eseguito se si verifica un errore di recupero `FileUploadResult`. Richiamato con un oggetto `FileTransferError`. *(Funzione)* * **opzioni**: parametri facoltativi *(oggetto)*. Chiavi valide: * **fileKey**: il nome dell'elemento form. Valore predefinito è `file` . (DOMString) * **nome file**: il nome del file da utilizzare quando si salva il file sul server. Valore predefinito è `image.jpg` . (DOMString) - * **mimeType**: il tipo mime dei dati da caricare. Valore predefinito è `image/jpeg` . (DOMString) - * **params**: un insieme di coppie chiave/valore opzionale per passare nella richiesta HTTP. (Oggetto) - * **chunkedMode**: se a caricare i dati in modalità streaming chunked. Valore predefinito è `true` . (Boolean) - * **intestazioni**: mappa di valori nome/intestazione intestazione. Utilizzare una matrice per specificare più valori. (Oggetto) + * **httpMethod**: metodo HTTP da utilizzare - `PUT` o `POST`. Impostazioni predefinite per `POST`. (DOMString) + * **mimeType**: il tipo mime dei dati da caricare. Impostazioni predefinite su `image/jpeg`. (DOMString) + * **params**: un insieme di coppie chiave/valore opzionale per passare nella richiesta HTTP. (Object) + * **chunkedMode**: se a caricare i dati in modalità streaming chunked. Impostazione predefinita è `true`. (Boolean) + * **headers**: mappa di valori nome/intestazione intestazione. Utilizzare una matrice per specificare più valori. (Object) * **trustAllHosts**: parametro opzionale, valore predefinito è `false` . Se impostata su `true` , accetta tutti i certificati di sicurezza. Questo è utile poiché Android respinge i certificati autofirmati sicurezza. Non raccomandato per uso in produzione. Supportato su Android e iOS. *(boolean)* @@ -152,7 +162,7 @@ Il `FileTransfer` oggetto fornisce un modo per caricare i file utilizzando una r ## FileUploadResult -A `FileUploadResult` oggetto viene passato al metodo di callback di successo il `FileTransfer` dell'oggetto `upload()` metodo. +Un oggetto `FileUploadResult` viene passato al metodo di callback del metodo `upload()` dell'oggetto `FileTransfer` successo. ### Proprietà @@ -180,7 +190,7 @@ A `FileUploadResult` oggetto viene passato al metodo di callback di successo il * **successCallback**: un callback passato un `FileEntry` oggetto. *(Funzione)* -* **errorCallback**: un callback che viene eseguito se si verifica un errore durante il recupero del `Metadata` . Invocato con un `FileTransferError` oggetto. *(Funzione)* +* **errorCallback**: un callback che viene eseguito se si verifica un errore durante il recupero `FileEntry`. Richiamato con un oggetto `FileTransferError`. *(Function)* * **trustAllHosts**: parametro opzionale, valore predefinito è `false` . Se impostata su `true` , accetta tutti i certificati di sicurezza. Questo è utile perché Android respinge i certificati autofirmati sicurezza. Non raccomandato per uso in produzione. Supportato su Android e iOS. *(boolean)* @@ -246,7 +256,7 @@ Interrompe un trasferimento in corso. Il callback onerror viene passato un ogget ## FileTransferError -A `FileTransferError` oggetto viene passato a un callback di errore quando si verifica un errore. +Un oggetto `FileTransferError` viene passato a un callback di errore quando si verifica un errore. ### Proprietà @@ -258,7 +268,9 @@ A `FileTransferError` oggetto viene passato a un callback di errore quando si ve * **http_status**: codice di stato HTTP. Questo attributo è disponibile solo quando viene ricevuto un codice di risposta della connessione HTTP. (Numero) -* **eccezione**: O e.getMessage o e.toString (String) +* **body** Corpo della risposta. Questo attributo è disponibile solo quando viene ricevuta una risposta dalla connessione HTTP. (String) + +* **exception**: O e.getMessage o e.toString (String) ### Costanti @@ -278,13 +290,13 @@ Versioni precedenti di questo plugin accetterebbe solo dispositivo-assoluto-perc Per indietro compatibilità, questi percorsi sono ancora accettati, e se l'applicazione ha registrato percorsi come questi in un archivio permanente, quindi possono continuare a essere utilizzato. -Questi percorsi sono state precedentemente esposte nella `fullPath` proprietà di `FileEntry` e `DirectoryEntry` oggetti restituiti dal File plugin. Nuove versioni del File plugin, tuttavia, non è più espongono questi percorsi a JavaScript. +Questi percorsi sono stati precedentemente esposti nella proprietà `fullPath` di `FileEntry` e oggetti `DirectoryEntry` restituiti dal File plugin. Nuove versioni del File plugin, tuttavia, non è più espongono questi percorsi a JavaScript. -Se si esegue l'aggiornamento a una nuova (1.0.0 o più recente) precedentemente utilizzano la versione del File e si `entry.fullPath` come argomenti a `download()` o `upload()` , sarà necessario modificare il codice per utilizzare gli URL filesystem invece. +Se si esegue l'aggiornamento a una nuova (1.0.0 o più recente) versione del File e si hanno precedentemente utilizzato `entry.fullPath` come argomenti per `download()` o `upload()`, quindi sarà necessario cambiare il codice per utilizzare gli URL filesystem invece. -`FileEntry.toURL()`e `DirectoryEntry.toURL()` restituiscono un filesystem URL del modulo +`FileEntry.toURL()` e `DirectoryEntry.toURL()` restituiscono un filesystem URL del modulo cdvfile://localhost/persistent/path/to/file -che può essere utilizzato al posto del percorso assoluto in entrambi `download()` e `upload()` metodi. \ No newline at end of file +che può essere utilizzato al posto del percorso assoluto nei metodi sia `download()` e `upload()`. \ No newline at end of file diff --git a/doc/ja/index.md b/doc/ja/index.md index 49cd44e..1f20e05 100644 --- a/doc/ja/index.md +++ b/doc/ja/index.md @@ -21,6 +21,16 @@ このプラグインは、アップロードし、ファイルをダウンロードすることができます。 +このプラグインでは、グローバル `FileTransfer`、`FileUploadOptions` コンス トラクターを定義します。 + +グローバル スコープでは使用できませんまで `deviceready` イベントの後です。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(FileTransfer); + } + + ## インストール cordova plugin add org.apache.cordova.file-transfer @@ -31,21 +41,20 @@ * アマゾン火 OS * アンドロイド * ブラックベリー 10 +* ブラウザー * Firefox の OS * * * iOS * Windows Phone 7 と 8 * -* Windows 8 * * *| -* Windows * * *| +* Windows 8 +* Windows -**サポートしていない `onprogress` も `abort()` * +* *`onprogress` も `abort()` をサポートしていません* -* **サポートしていない `onprogress` * +* * *`onprogress` をサポートしていません* -部分的なサポート `onprogress` のアップロード方法 `onprogress` は Windows limitations_ のための空のプログレスのイベントで呼び出されます。 +# FileTransfer -# ファイル転送 - -`FileTransfer`オブジェクトはマルチパートのポスト、HTTP 要求を使用してファイルをアップロードして同様にファイルをダウンロードする方法を提供します。 +`FileTransfer` オブジェクトはマルチパートのポスト、HTTP 要求を使用してファイルをアップロードして同様にファイルをダウンロードする方法を提供します。 ## プロパティ @@ -59,7 +68,7 @@ * **中止**: 進行中の転送を中止します。 -## アップロード +## upload **パラメーター**: @@ -67,18 +76,19 @@ * **サーバー**: によって符号化されるように、ファイルを受信するサーバーの URL`encodeURI()`. -* **successCallback**: 渡されたコールバックを `Metadata` オブジェクト。*(機能)* +* **successCallback**: `FileUploadResult` オブジェクトが渡されるコールバック。*(機能)* -* **解り**: エラー取得が発生した場合に実行されるコールバック、 `Metadata` 。呼び出されると、 `FileTransferError` オブジェクト。*(機能)* +* **errorCallback**: エラー `FileUploadResult` を取得するが発生した場合に実行されるコールバック。`FileTransferError` オブジェクトを使って呼び出されます。*(機能)* * **オプション**: 省略可能なパラメーター *(オブジェクト)*。有効なキー: * **fileKey**: フォーム要素の名前。既定値は `file` です。(,) * **ファイル名**: ファイル名、サーバー上のファイルを保存するときに使用します。既定値は `image.jpg` です。(,) - * **mime タイプ**: アップロードするデータの mime タイプ。既定値は `image/jpeg` です。(,) + * **httpMethod**: - `を置く` または `POST` のいずれかを使用する HTTP メソッド。デフォルト `のポスト` です。(,) + * **mimeType**: アップロードするデータの mime タイプ。`イメージ/jpeg` のデフォルトです。(,) * **params**: HTTP リクエストに渡すために任意のキー/値ペアのセット。(オブジェクト) - * **chunkedMode**: チャンク ストリーミング モードでデータをアップロードするかどうか。既定値は `true` です。(ブール値) - * **ヘッダー**: ヘッダーの名前/ヘッダー値のマップ。1 つ以上の値を指定するには、配列を使用します。(オブジェクト) + * **chunkedMode**: チャンク ストリーミング モードでデータをアップロードするかどうか。デフォルトは `true` です。(ブール値) + * **headers**: ヘッダーの名前/ヘッダー値のマップ。1 つ以上の値を指定するには、配列を使用します。(オブジェクト) * **trustAllHosts**: 省略可能なパラメーターは、デフォルト `false` 。 場合設定 `true` 、セキュリティ証明書をすべて受け付けます。 これは Android の自己署名入りセキュリティ証明書を拒否するので便利です。 運用環境で使用しないでください。 Android と iOS でサポートされています。 *(ブール値)* @@ -152,7 +162,7 @@ ## FileUploadResult -A `FileUploadResult` オブジェクトの成功時のコールバックに渡される、 `FileTransfer` オブジェクトの `upload()` メソッド。 +`FileUploadResult` オブジェクトは `FileTransfer` オブジェクト `upload()` メソッドの成功時のコールバックに渡されます。 ### プロパティ @@ -170,7 +180,7 @@ A `FileUploadResult` オブジェクトの成功時のコールバックに渡 * サポートしていない `responseCode` または`bytesSent`. -## ダウンロード +## download **パラメーター**: @@ -180,7 +190,7 @@ A `FileUploadResult` オブジェクトの成功時のコールバックに渡 * **successCallback**: 渡されたコールバックを `FileEntry` オブジェクト。*(機能)* -* **解り**: コールバックを取得するときにエラーが発生した場合に実行される、 `Metadata` 。呼び出されると、 `FileTransferError` オブジェクト。*(機能)* +* **errorCallback**: `FileEntry` を取得するときにエラーが発生した場合に実行されるコールバック。`FileTransferError` オブジェクトを使って呼び出されます。*(機能)* * **trustAllHosts**: 省略可能なパラメーターは、デフォルト `false` 。 場合設定 `true` 、セキュリティ証明書をすべて受け付けます。 Android は、自己署名入りセキュリティ証明書を拒否しますので便利です。 運用環境で使用しないでください。 Android と iOS でサポートされています。 *(ブール値)* @@ -214,7 +224,7 @@ A `FileUploadResult` オブジェクトの成功時のコールバックに渡 ); -## 中止 +## abort 進行中の転送を中止します。Onerror コールバックが FileTransferError.ABORT_ERR のエラー コードを持っている FileTransferError オブジェクトに渡されます。 @@ -246,7 +256,7 @@ A `FileUploadResult` オブジェクトの成功時のコールバックに渡 ## FileTransferError -A `FileTransferError` オブジェクトは、エラーが発生エラー コールバックに渡されます。 +`FileTransferError` オブジェクトは、エラーが発生したときにエラー コールバックに渡されます。 ### プロパティ @@ -258,7 +268,9 @@ A `FileTransferError` オブジェクトは、エラーが発生エラー コー * **http_status**: HTTP ステータス コード。この属性は、HTTP 接続から応答コードを受信したときにのみ使用できます。(数) -* **例外**: どちらか e.getMessage または e.toString (文字列) +* **body**応答本体。この属性は、HTTP 接続から応答を受信したときにのみ使用できます。(文字列) + +* **exception**: どちらか e.getMessage または e.toString (文字列) ### 定数 @@ -278,13 +290,13 @@ A `FileTransferError` オブジェクトは、エラーが発生エラー コー 下位互換性、これらのパスを使用しても、アプリケーションは、永続的なストレージでこのようなパスを記録している場合、し彼らが引き続き使用されます。 -これらのパスに公開されていなかった、 `fullPath` のプロパティ `FileEntry` および `DirectoryEntry` ファイル プラグインによって返されるオブジェクト。 新しいプラグインのバージョン、ファイル、ただし、もはや java スクリプトの設定をこれらのパスを公開します。 +これらのパスの `FileEntry` やファイル プラグインによって返される `DirectoryEntry` オブジェクトの `fullPath` プロパティで公開されていなかった。 新しいプラグインのバージョン、ファイル、ただし、もはや java スクリプトの設定をこれらのパスを公開します。 -新しいにアップグレードする場合 (1.0.0 以降) ファイルのバージョンが以前を使用して `entry.fullPath` への引数として `download()` または `upload()` 、ファイルシステムの Url を代わりに使用するコードを変更する必要があります。 +新しいにアップグレードする場合 (1.0.0 以降) ファイルのバージョン以前を使用している `entry.fullPath` `download()` または `upload()` への引数として、ファイルシステムの Url を代わりに使用するコードを変更する必要があります。 -`FileEntry.toURL()``DirectoryEntry.toURL()`フォームのファイルシステムの URL を返す +`FileEntry.toURL()` と `DirectoryEntry.toURL()` ファイルシステムの URL を返すフォーム cdvfile://localhost/persistent/path/to/file -両方のファイルの絶対パスの代わりに使用できる `download()` および `upload()` メソッド。 \ No newline at end of file +`download()`、`upload()` メソッドの絶対ファイル パスの代わりに使用できます。 \ No newline at end of file diff --git a/doc/ko/index.md b/doc/ko/index.md index 1289567..6ca8593 100644 --- a/doc/ko/index.md +++ b/doc/ko/index.md @@ -21,6 +21,16 @@ 이 플러그인을 사용 하면 업로드 및 다운로드 파일 수 있습니다. +이 플러그인 글로벌 `FileTransfer`, `FileUploadOptions` 생성자를 정의합니다. + +전역 범위에서 그들은 제공 되지 않습니다 때까지 `deviceready` 이벤트 후. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(FileTransfer); + } + + ## 설치 cordova plugin add org.apache.cordova.file-transfer @@ -31,21 +41,20 @@ * 아마존 화재 운영 체제 * 안 드 로이드 * 블랙베리 10 +* 브라우저 * 파이어 폭스 OS * * * iOS * Windows Phone 7과 8 * -* 윈도우 8 * * *| -* 윈도 즈 * * *| +* 윈도우 8 +* 윈도우 -* *를 지원 하지 않는 `onprogress` 도 `abort()` * +* *`onprogress`도 `abort()`를 지원 하지 않습니다* -* * *를 지원 하지 않는 `onprogress` * - -부분적인 지원 `onprogress` 업로드 방법. `onprogress` Windows limitations_로 인해 빈 진행률 이벤트 호출 +* * *`onprogress`를 지원 하지 않습니다* # FileTransfer -`FileTransfer`개체는 HTTP 다중 파트 POST 요청을 사용 하 여 파일을 업로드 하 고 뿐만 아니라 파일을 다운로드 하는 방법을 제공 합니다. +`FileTransfer` 개체는 HTTP 다중 파트 POST 요청을 사용 하 여 파일 업로드 뿐만 아니라 파일을 다운로드 하는 방법을 제공 합니다. ## 속성 @@ -67,18 +76,19 @@ * **서버**: 인코딩 파일 수신 서버의 URL`encodeURI()`. -* **successCallback**: 콜백 전달 되는 `Metadata` 개체. *(기능)* +* **successCallback**: `FileUploadResult` 개체를 전달 하는 콜백. *(기능)* -* **errorCallback**: 콜백 검색에 오류가 발생 하면 실행 되는 `Metadata` . 로 호출을 `FileTransferError` 개체. *(기능)* +* **errorCallback**: `FileUploadResult` 검색에 오류가 발생 하면 실행 되는 콜백. `FileTransferError` 개체와 함께 호출 됩니다. *(기능)* * **옵션**: 선택적 매개 변수 *(개체)*. 유효한 키: * **fileKey**: form 요소의 이름. 기본값은 `file` . (DOMString) * **파일 이름**: 파일 이름을 서버에 파일을 저장할 때 사용 합니다. 기본값은 `image.jpg` . (DOMString) - * **mimeType**: 업로드 데이터의 mime 형식을. 기본값은 `image/jpeg` . (DOMString) + * **httpMethod**: `넣어` 또는 `게시물`-사용 하도록 HTTP 메서드. `게시물` 기본값입니다. (DOMString) + * **mimeType**: 업로드 데이터의 mime 형식을. `이미지/jpeg`의 기본값입니다. (DOMString) * **params**: HTTP 요청에 전달할 선택적 키/값 쌍의 집합. (개체) - * **chunkedMode**: 청크 스트리밍 모드에서 데이터 업로드를 합니다. 기본값은 `true` . (부울) - * **헤더**: 헤더 이름/헤더 값의 지도. 배열을 사용 하 여 하나 이상의 값을 지정 합니다. (개체) + * **chunkedMode**: 청크 스트리밍 모드에서 데이터 업로드를 합니다. 기본값은 `true`입니다. (부울) + * **headers**: 헤더 이름/헤더 값의 지도. 배열을 사용 하 여 하나 이상의 값을 지정 합니다. (개체) * **trustAllHosts**: 선택적 매개 변수는 기본적으로 `false` . 만약 설정 `true` , 그것은 모든 보안 인증서를 허용 합니다. 이 안 드 로이드 자체 서명 된 보안 인증서를 거부 하기 때문에 유용 합니다. 프로덕션 환경에서 사용 권장 되지 않습니다. 안 드 로이드와 iOS에서 지원. *(부울)* @@ -152,7 +162,7 @@ ## FileUploadResult -A `FileUploadResult` 개체의 성공 콜백에 전달 되는 `FileTransfer` 개체의 `upload()` 메서드. +`FileUploadResult` 개체 `FileTransfer` 개체의 `원래` 방법의 성공 콜백에 전달 됩니다. ### 속성 @@ -160,9 +170,9 @@ A `FileUploadResult` 개체의 성공 콜백에 전달 되는 `FileTransfer` 개 * **responseCode**: 서버에서 반환 된 HTTP 응답 코드. (긴) -* **응답**: 서버에서 반환 되는 HTTP 응답. (DOMString) +* **response**: 서버에서 반환 되는 HTTP 응답. (DOMString) -* **머리글**: 서버에서 HTTP 응답 헤더. (개체) +* **headers**: 서버에서 HTTP 응답 헤더. (개체) * 현재 ios만 지원 합니다. @@ -170,21 +180,21 @@ A `FileUploadResult` 개체의 성공 콜백에 전달 되는 `FileTransfer` 개 * 지원 하지 않는 `responseCode` 또는`bytesSent`. -## 다운로드 +## download **매개 변수**: -* **소스**: URL로 인코딩된 파일, 다운로드 서버`encodeURI()`. +* **source**: URL로 인코딩된 파일, 다운로드 서버`encodeURI()`. -* **대상**: 장치에 파일을 나타내는 파일 시스템 url. 에 대 한 이전 버전과 호환성을이 수도 장치에 있는 파일의 전체 경로 수. (참조 [거꾸로 호환성 노트] 아래) +* **target**: 장치에 파일을 나타내는 파일 시스템 url. 에 대 한 이전 버전과 호환성을이 수도 장치에 있는 파일의 전체 경로 수. (참조 [거꾸로 호환성 노트] 아래) * **successCallback**: 콜백 전달 되는 `FileEntry` 개체. *(기능)* -* **errorCallback**: 콜백 검색할 때 오류가 발생 하면 실행 되는 `Metadata` . 로 호출을 `FileTransferError` 개체. *(기능)* +* **errorCallback**: `FileEntry`를 검색할 때 오류가 발생 하면 실행 되는 콜백. `FileTransferError` 개체와 함께 호출 됩니다. *(기능)* * **trustAllHosts**: 선택적 매개 변수는 기본적으로 `false` . 만약 설정 `true` , 그것은 모든 보안 인증서를 허용 합니다. 안 드 로이드 자체 서명 된 보안 인증서를 거부 하기 때문에 유용 합니다. 프로덕션 환경에서 사용 권장 되지 않습니다. 안 드 로이드와 iOS에서 지원. *(부울)* -* **옵션**: 선택적 매개 변수를 현재 지 원하는 머리글만 (예: 인증 (기본 인증), 등). +* **options**: 선택적 매개 변수를 현재 지 원하는 머리글만 (예: 인증 (기본 인증), 등). ### 예를 들어 @@ -214,9 +224,9 @@ A `FileUploadResult` 개체의 성공 콜백에 전달 되는 `FileTransfer` 개 ); -## 중단 +## abort -진행 중인 전송을 중단합니다. Onerror 콜백 FileTransferError.ABORT_ERR의 오류 코드는 FileTransferError 개체를 전달 합니다. +진행 중인 전송을 중단합니다. onerror 콜백 FileTransferError.ABORT_ERR의 오류 코드는 FileTransferError 개체를 전달 합니다. ### 예를 들어 @@ -246,19 +256,21 @@ A `FileUploadResult` 개체의 성공 콜백에 전달 되는 `FileTransfer` 개 ## FileTransferError -A `FileTransferError` 오류가 발생 하면 오류 콜백 개체 전달 됩니다. +`FileTransferError` 개체 오류가 발생 하면 오류 콜백에 전달 됩니다. ### 속성 -* **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된. (수) +* **code**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된. (수) -* **소스**: 소스 URL. (문자열) +* **source**: 소스 URL. (문자열) -* **대상**: 대상 URL. (문자열) +* **target**: 대상 URL. (문자열) * **http_status**: HTTP 상태 코드. 이 특성은 응답 코드를 HTTP 연결에서 수신에 사용할 수 있습니다. (수) -* **예외**: 어느 e.getMessage 또는 e.toString (문자열) +* **body** 응답 본문입니다. 이 특성은 HTTP 연결에서 응답을 받을 때에 사용할 수 있습니다. (문자열) + +* **exception**: 어느 e.getMessage 또는 e.toString (문자열) ### 상수 @@ -278,13 +290,13 @@ A `FileTransferError` 오류가 발생 하면 오류 콜백 개체 전달 됩니 대 한 뒤 호환성, 이러한 경로 여전히 허용, 그리고 응용 프로그램이 영구 저장소에서 이와 같은 경로 기록 했다, 그때 그들은 계속할 수 있다면 사용할 수. -이 경로에 노출 되었던는 `fullPath` 속성의 `FileEntry` 및 `DirectoryEntry` 파일 플러그인에 의해 반환 된 개체. 그러나 파일 플러그인의,, 더 이상 새로운 버전 자바 스크립트이 경로 노출. +이러한 경로 `FileEntry` 및 파일 플러그인에 의해 반환 된 `DirectoryEntry` 개체의 `fullPath` 속성에 노출 되었던. 그러나 파일 플러그인의,, 더 이상 새로운 버전 자바 스크립트이 경로 노출. -새로 업그레이드 하는 경우 (1.0.0 이상) 파일의 버전을 사용 하고있다 이전 `entry.fullPath` 인수로 `download()` 또는 `upload()` , 다음 대신 파일 시스템 Url을 사용 하 여 코드를 변경 해야 합니다. +새로 업그레이드 하는 경우 (1.0.0 이상) 버전의 파일, 및 이전 사용 하 고 `entry.fullPath` `download()` 또는 `upload()` 인수로 다음 대신 파일 시스템 Url을 사용 하 여 코드를 변경 해야 합니다. -`FileEntry.toURL()`그리고 `DirectoryEntry.toURL()` 폼의 파일 URL을 반환 +폼의 파일 URL을 반환 하는 `FileEntry.toURL()` 및 `DirectoryEntry.toURL()` cdvfile://localhost/persistent/path/to/file -둘 다에서 절대 파일 경로 대신 사용할 수 있는 `download()` 및 `upload()` 메서드. \ No newline at end of file +어떤 `download()` 및 `upload()` 방법에서 절대 파일 경로 대신 사용할 수 있습니다. \ No newline at end of file diff --git a/doc/pl/index.md b/doc/pl/index.md index 644a418..7cddfaa 100644 --- a/doc/pl/index.md +++ b/doc/pl/index.md @@ -21,6 +21,16 @@ Plugin pozwala na przesyłanie i pobieranie plików. +Ten plugin określa globalne `FileTransfer`, `FileUploadOptions` konstruktorów. + +Chociaż w globalnym zasięgu, są nie dostępne dopiero po `deviceready` imprezie. + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(FileTransfer); + } + + ## Instalacja cordova plugin add org.apache.cordova.file-transfer @@ -31,21 +41,20 @@ Plugin pozwala na przesyłanie i pobieranie plików. * Amazon Fire OS * Android * BlackBerry 10 +* Przeglądarka * Firefox OS ** * iOS * Windows Phone 7 i 8 * -* Windows 8 ***| -* Windows ***| +* Windows 8 +* Windows -* *Nie obsługują `onprogress` ani `abort()` * +* *Nie obsługują `onprogress` ani `abort()`* -** *Nie obsługują `onprogress` * - -Częściowe wsparcie `onprogress` dla przesłać Metoda. `onprogress` jest wywoływana z zdarzenie progress pusty z powodu Windows limitations_ +* * *Nie obsługują `onprogress`* # FileTransfer -`FileTransfer`Obiekt zapewnia sposób wgrać pliki przy użyciu żądania HTTP wieloczęściowe POST i pobierania plików, jak również. +Obiekt `FileTransfer` zapewnia sposób wgrać pliki przy użyciu żądania HTTP wieloczęściowe POST i pobierania plików, jak również. ## Właściwości @@ -67,18 +76,19 @@ Częściowe wsparcie `onprogress` dla przesłać Metoda. `onprogress` jest wywo * **serwer**: adres URL serwera, aby otrzymać plik, jak kodowane przez`encodeURI()`. -* **successCallback**: wywołania zwrotnego, który jest przekazywany `Metadata` obiektu. *(Funkcja)* +* **successCallback**: wywołania zwrotnego, który jest przekazywany obiekt `FileUploadResult`. *(Funkcja)* -* **errorCallback**: wywołanie zwrotne, które wykonuje, jeżeli wystąpi błąd pobierania `Metadata` . Wywołany z `FileTransferError` obiektu. *(Funkcja)* +* **errorCallback**: wywołanie zwrotne, które wykonuje, jeżeli wystąpi błąd pobierania `FileUploadResult`. Wywoływany z obiektu `FileTransferError`. *(Funkcja)* * **Opcje**: parametry opcjonalne *(obiektu)*. Ważne klucze: * **fileKey**: nazwa elementu form. Domyślnie `file` . (DOMString) * **Nazwa pliku**: nazwy pliku, aby użyć podczas zapisywania pliku na serwerze. Domyślnie `image.jpg` . (DOMString) - * **mimeType**: Typ mime danych do przesłania. Domyślnie `image/jpeg` . (DOMString) - * **Parametry**: zestaw par opcjonalny klucz/wartość w żądaniu HTTP. (Obiekt) - * **chunkedMode**: czy przekazać dane w trybie pakietowego przesyłania strumieniowego. Domyślnie `true` . (Wartość logiczna) - * **nagłówki**: Mapa wartości Nazwa/nagłówka nagłówek. Aby określić więcej niż jedną wartość, należy użyć tablicę. (Obiekt) + * **element httpMethod**: Metoda HTTP do użycia - `umieścić` lub `POST`. Domyślnie `POST`. (DOMString) + * **mimeType**: Typ mime danych do przesłania. Domyślnie do `image/jpeg`. (DOMString) + * **params**: zestaw par opcjonalny klucz/wartość w żądaniu HTTP. (Obiekt) + * **chunkedMode**: czy przekazać dane w trybie pakietowego przesyłania strumieniowego. Wartością domyślną jest `true`. (Wartość logiczna) + * **headers**: Mapa wartości Nazwa/nagłówka nagłówek. Aby określić więcej niż jedną wartość, należy użyć tablicę. (Obiekt) * **trustAllHosts**: parametr opcjonalny, domyślnie `false` . Jeśli zestaw `true` , to akceptuje wszystkie certyfikaty bezpieczeństwa. Jest to przydatne, ponieważ Android odrzuca Certyfikaty samopodpisane. Nie zaleca się do użytku produkcyjnego. Obsługiwane na Androida i iOS. *(wartość logiczna)* @@ -152,7 +162,7 @@ Częściowe wsparcie `onprogress` dla przesłać Metoda. `onprogress` jest wywo ## FileUploadResult -A `FileUploadResult` obiekt jest przekazywany do funkcji callback sukces z `FileTransfer` obiektu `upload()` Metoda. +Obiekt `FileUploadResult` jest przekazywana do sukcesu wywołania zwrotnego metody `upload() służącą` obiektu `FileTransfer`. ### Właściwości @@ -170,7 +180,7 @@ A `FileUploadResult` obiekt jest przekazywany do funkcji callback sukces z `File * Nie obsługuje `responseCode` lub`bytesSent`. -## Pobierz za darmo +## download **Parametry**: @@ -180,7 +190,7 @@ A `FileUploadResult` obiekt jest przekazywany do funkcji callback sukces z `File * **successCallback**: wywołania zwrotnego, który jest przekazywany `FileEntry` obiektu. *(Funkcja)* -* **errorCallback**: wywołanie zwrotne, które wykonuje, jeśli wystąpi błąd podczas pobierania `Metadata` . Wywołany z `FileTransferError` obiektu. *(Funkcja)* +* **errorCallback**: wywołanie zwrotne, które wykonuje, jeśli wystąpi błąd podczas pobierania `FileEntry`. Wywoływany z obiektu `FileTransferError`. *(Funkcja)* * **trustAllHosts**: parametr opcjonalny, domyślnie `false` . Jeśli zestaw `true` , to akceptuje wszystkie certyfikaty bezpieczeństwa. Jest to przydatne, ponieważ Android odrzuca Certyfikaty samopodpisane. Nie zaleca się do użytku produkcyjnego. Obsługiwane na Androida i iOS. *(wartość logiczna)* @@ -214,7 +224,7 @@ A `FileUploadResult` obiekt jest przekazywany do funkcji callback sukces z `File ); -## przerwanie +## abort Przerywa w toku transferu. Onerror callback jest przekazywany obiekt FileTransferError, który kod błędu z FileTransferError.ABORT_ERR. @@ -246,7 +256,7 @@ Przerywa w toku transferu. Onerror callback jest przekazywany obiekt FileTransfe ## FileTransferError -A `FileTransferError` obiekt jest przekazywany do wywołania zwrotnego błąd, gdy wystąpi błąd. +Obiekt `FileTransferError` jest przekazywana do błąd wywołania zwrotnego, gdy wystąpi błąd. ### Właściwości @@ -258,7 +268,9 @@ A `FileTransferError` obiekt jest przekazywany do wywołania zwrotnego błąd, g * **HTTP_STATUS**: kod stanu HTTP. Ten atrybut jest dostępna tylko po otrzymaniu kodu odpowiedzi z połączenia HTTP. (Liczba) -* **wyjątek**: albo e.getMessage lub e.toString (String) +* **body** Treść odpowiedzi. Ten atrybut jest dostępna tylko wtedy, gdy odpowiedź jest otrzymanych od połączenia HTTP. (String) + +* **exception**: albo e.getMessage lub e.toString (String) ### Stałe @@ -278,13 +290,13 @@ Poprzednie wersje tego pluginu tylko zaakceptować urządzenia bezwzględnych ś Do tyłu zgodności, akceptowane są jeszcze te ścieżki, i jeśli aplikacja nagrał ścieżki, jak te w trwałej pamięci, następnie można nadal stosować. -Te ścieżki były wcześniej wystawione w `fullPath` właściwości `FileEntry` i `DirectoryEntry` obiektów zwróconych przez wtyczki pliku. Nowe wersje pliku plugin, jednak już wystawiać te ścieżki do JavaScript. +Te ścieżki były narażone wcześniej we właściwości `fullPath` `FileEntry` i `DirectoryEntry` obiektów zwróconych przez wtyczki pliku. Nowe wersje pliku plugin, jednak już wystawiać te ścieżki do JavaScript. -Jeśli uaktualniasz nowy (1.0.0 lub nowsza) wersji pliku, a wcześniej za pomocą `entry.fullPath` jako argumenty do `download()` lub `upload()` , a następnie trzeba będzie zmienić kod aby używać adresów URL plików zamiast. +Jeśli uaktualniasz nowy (1.0.0 lub nowsza) wersja pliku i mieć wcześniej przy `entry.fullPath` jako argumenty `download()` lub `upload() służącą`, a następnie trzeba będzie zmienić kod aby używać adresów URL plików zamiast. -`FileEntry.toURL()`i `DirectoryEntry.toURL()` zwraca adres URL plików formularza +`FileEntry.toURL()` i `DirectoryEntry.toURL()` zwraca adres URL plików formularza cdvfile://localhost/persistent/path/to/file -które mogą być używane zamiast bezwzględna ścieżka w obu `download()` i `upload()` metody. \ No newline at end of file +które mogą być używane zamiast bezwzględna ścieżka zarówno `download()` i `metody upload()` metody. \ No newline at end of file diff --git a/doc/zh/index.md b/doc/zh/index.md index 6c5aac8..e7801f4 100644 --- a/doc/zh/index.md +++ b/doc/zh/index.md @@ -21,6 +21,16 @@ 這個外掛程式允許你上傳和下載檔案。 +這個外掛程式定義全域 `FileTransfer`,`FileUploadOptions` 的建構函式。 + +雖然在全球範圍內,他們不可用直到 `deviceready` 事件之後。 + + document.addEventListener("deviceready", onDeviceReady, false); + function onDeviceReady() { + console.log(FileTransfer); + } + + ## 安裝 cordova plugin add org.apache.cordova.file-transfer @@ -31,21 +41,20 @@ * 亞馬遜火 OS * Android 系統 * 黑莓 10 -* 火狐瀏覽器作業系統 * * +* 瀏覽器 +* 火狐瀏覽器的作業系統 * * * iOS * Windows Phone 7 和 8 * -* Windows 8 * * *| -* Windows * * *| +* Windows 8 +* Windows -**不支援 `onprogress` ,也不 `abort()` * +* *不支援 `onprogress` 也 `abort()`* -* **不支援 `onprogress` * +* * *不支援 `onprogress`* -部分支援的 `onprogress` 為上傳方法。 `onprogress` 被稱為與 Windows limitations_ 空白進度事件 +# FileTransfer -# 檔案傳輸 - -`FileTransfer`物件提供一種方法使用 HTTP 多部分 POST 請求的檔上傳和下載檔案,以及。 +`FileTransfer` 物件提供一種使用 HTTP 多部分 POST 請求的檔上傳,下載檔案以及方式。 ## 屬性 @@ -53,32 +62,33 @@ ## 方法 -* **上傳**: 將檔發送到伺服器。 +* **upload**: 將檔發送到伺服器。 -* **下載**: 從伺服器上下載檔案。 +* **download**: 從伺服器上下載檔案。 -* **中止**: 中止正在進行轉讓。 +* **abort**: 中止正在進行轉讓。 -## 上傳 +## upload **參數**: * **fileURL**: 表示檔在設備上的檔案系統 URL。 為向後相容性,這也可以將設備上的檔的完整路徑。 (請參見 [向後相容性注意到] 下面) -* **伺服器**: 伺服器以接收該檔,由編碼的 URL`encodeURI()`. +* **server**: 伺服器以接收該檔,由編碼的 URL`encodeURI()`. -* **successCallback**: 傳遞一個回檔 `Metadata` 物件。*(函數)* +* **successCallback**: 一個通過一個 `FileUploadResult` 物件的回檔。*(函數)* -* **errorCallback**: 回檔的執行如果出現檢索錯誤 `Metadata` 。調用與 `FileTransferError` 物件。*(函數)* +* **errorCallback**: 如果發生錯誤,檢索 `FileUploadResult` 執行一個回檔。使用 `FileTransferError` 物件調用。*(函數)* -* **選項**: 可選參數*(物件)*。有效的金鑰: +* **options**: 可選參數*(物件)*。有效的金鑰: * **fileKey**: 表單元素的名稱。預設值為 `file` 。() DOMString - * **檔案名**: 要保存在伺服器上的檔時使用的檔案名稱。預設值為 `image.jpg` 。() DOMString - * **mimeType**: 要上傳的資料的 mime 類型。預設值為 `image/jpeg` 。() DOMString - * **params**: 一組可選的鍵/值對在 HTTP 要求中傳遞。(物件) - * **chunkedMode**: 是否要分塊流式處理模式中的資料上載。預設值為 `true` 。(布林值) - * **標題**: 地圖的標頭名稱/標頭值。使用陣列來指定多個值。(物件) + * **fileName**: 要保存在伺服器上的檔時使用的檔案名稱。預設值為 `image.jpg` 。() DOMString + * **httpMethod**: HTTP 方法使用-`PUT` 或 `POST`。預設值為 `POST`。() DOMString + * **mimeType**: 要上載的資料的 mime 類型。預設設置為 `image/jpeg`。() DOMString + * **params**: 一組要在 HTTP 要求中傳遞的可選的鍵值對。(物件) + * **chunkedMode**: 是否要分塊的流式處理模式中的資料上載。預設值為 `true`。(布林值) + * **headers**: 地圖的標頭名稱/標頭值。使用陣列來指定多個值。(物件) * **trustAllHosts**: 可選參數,預設值為 `false` 。 如果設置為 `true` ,它接受的所有安全證書。 這是有用的因為 android 系統拒絕自簽名的安全證書。 不建議供生產使用。 支援 Android 和 iOS。 *(布林值)* @@ -152,17 +162,17 @@ ## FileUploadResult -A `FileUploadResult` 物件傳遞給成功回檔的 `FileTransfer` 物件的 `upload()` 方法。 +`FileUploadResult` 物件將傳遞給該 `檔案傳輸` 物件的 `upload()` 方法的成功回檔。 ### 屬性 -* **位元組發送**: 作為上載的一部分發送到伺服器的位元組數。(長) +* **bytesSent**: 作為上載的一部分發送到伺服器的位元組數。(長) * **responseCode**: 由伺服器返回的 HTTP 回應代碼。(長) -* **回應**: 由伺服器返回的 HTTP 回應。() DOMString +* **response**: 由伺服器返回的 HTTP 回應。() DOMString -* **標題**: 由伺服器的 HTTP 回應標頭。(物件) +* **headers**: 由伺服器的 HTTP 回應標頭。(物件) * 目前支援的 iOS 只。 @@ -170,21 +180,21 @@ A `FileUploadResult` 物件傳遞給成功回檔的 `FileTransfer` 物件的 `up * 不支援 `responseCode` 或`bytesSent`. -## 下載 +## download **參數**: -* **來源**: 要下載的檔,如由編碼的伺服器的 URL`encodeURI()`. +* **source**: 要下載的檔,如由編碼的伺服器的 URL`encodeURI()`. -* **目標**: 表示檔在設備上的檔案系統 url。 為向後相容性,這也可以將設備上的檔的完整路徑。 (請參見 [向後相容性注意到] 下面) +* **target**: 表示檔在設備上的檔案系統 url。 為向後相容性,這也可以將設備上的檔的完整路徑。 (請參見 [向後相容性注意到] 下面) * **successCallback**: 傳遞一個回檔 `FileEntry` 物件。*(函數)* -* **errorCallback**: 如果錯誤發生在檢索時將執行的回檔 `Metadata` 。調用與 `FileTransferError` 物件。*(函數)* +* **errorCallback**: 如果檢索 `FileEntry` 時發生錯誤,則執行一個回檔。使用 `FileTransferError` 物件調用。*(函數)* * **trustAllHosts**: 可選參數,預設值為 `false` 。 如果設置為 `true` ,它可以接受的所有安全證書。 這是有用的因為 Android 拒絕自行簽署式安全證書。 不建議供生產使用。 在 Android 和 iOS 上受支援。 *(布林值)* -* **選項**: 可選參數,目前只支援標題 (如授權 (基本驗證) 等)。 +* **options**: 可選參數,目前只支援標題 (如授權 (基本驗證) 等)。 ### 示例 @@ -214,9 +224,9 @@ A `FileUploadResult` 物件傳遞給成功回檔的 `FileTransfer` 物件的 `up ); -## 中止 +## abort -中止正在進行轉讓。Onerror 回檔傳遞的錯誤代碼為 FileTransferError.ABORT_ERR 的 FileTransferError 物件。 +中止正在進行轉讓。Onerror 回檔傳遞一個 FileTransferError 物件具有 FileTransferError.ABORT_ERR 錯誤代碼。 ### 示例 @@ -246,19 +256,21 @@ A `FileUploadResult` 物件傳遞給成功回檔的 `FileTransfer` 物件的 `up ## FileTransferError -A `FileTransferError` 物件被傳遞給一個錯誤回呼函數時出現錯誤。 +當發生錯誤時,`FileTransferError` 物件將傳遞給錯誤回檔。 ### 屬性 -* **代碼**: 下面列出的預定義的錯誤代碼之一。(人數) +* **code**: 下面列出的預定義的錯誤代碼之一。(人數) -* **源**: 源的 URL。(字串) +* **source**: 源的 URL。(字串) -* **目標**: 到目標 URL。(字串) +* **target**: 到目標 URL。(字串) * **HTTP_status**: HTTP 狀態碼。從 HTTP 連接收到一個回應代碼時,此屬性才可用。(人數) -* **例外**: 要麼 e.getMessage 或 e.toString (字串) +* **body**回應正文。此屬性只能是可用的當該 HTTP 連接收到答覆。(字串) + +* **exception**: 要麼 e.getMessage 或 e.toString (字串) ### 常量 @@ -270,21 +282,21 @@ A `FileTransferError` 物件被傳遞給一個錯誤回呼函數時出現錯誤 ## 向後相容性注意到 -以前版本的這個外掛程式才會接受設備-絕對檔路徑的源上傳,或作為下載的目標。這些路徑通常會在表單 +以前版本的這個外掛程式才會接受設備-絕對檔路徑作為源對於上載,或用於下載的目標。這些路徑通常會在表單 /var/mobile/Applications//Documents/path/to/file (iOS) /storage/emulated/0/path/to/file (Android) -為向後相容性,這些路徑仍被接受,和如果您的應用程式記錄了像這些在持久性存儲的路徑,然後他們可以繼續使用。 +為向後相容性,這些路徑仍會被接受,和如果您的應用程式已錄得像這些在持久性存儲的路徑,然後他們可以繼續使用。 -這些路徑被以前暴露在 `fullPath` 屬性的 `FileEntry` 和 `DirectoryEntry` 由檔外掛程式返回的物件。 新版本的檔的外掛程式,不過,不再公開這些 JavaScript 的路徑。 +這些路徑被以前暴露在 `FileEntry` 和由檔外掛程式返回的 `DirectoryEntry` 物件的 `fullPath` 屬性中。 新版本的檔的外掛程式,但是,不再公開這些 JavaScript 的路徑。 -如果您升級到一個新 (1.0.0 或更高版本) 版本的檔,和你以前一直在使用 `entry.fullPath` 作為的參數 `download()` 或 `upload()` ,那麼你將需要更改代碼以使用檔案系統的 Url 來代替。 +如果您要升級到新 (1.0.0 或更高版本) 版本的檔,和你以前一直在使用 `entry.fullPath` 作為參數到 `download()` 或 `upload()`,那麼你將需要更改代碼以使用檔案系統的 Url 來代替。 -`FileEntry.toURL()`和 `DirectoryEntry.toURL()` 返回的表單檔案系統 URL +`FileEntry.toURL()` 和 `DirectoryEntry.toURL()` 返回的表單檔案 URL cdvfile://localhost/persistent/path/to/file -其中可代替的絕對檔路徑在兩個 `download()` 和 `upload()` 的方法。 \ No newline at end of file +它可以用在 `download()` 和 `upload()` 兩種方法中的絕對檔路徑位置。 \ No newline at end of file