2017-10-10 1 views
0

안드로이드에서 새 파일을 업로드하려고 할 때 제대로 작동하지만 업로드 후 OS 6에서 작동하는 안드로이드 장치에서 업로드하려고 할 때 그것의 OnError 방법을가는이는 반응이다 :안드로이드 6 appcelerator에서 http 요청을 통해 PDF 파일을 업로드하는 동안 오류가 발생했습니다

[ERROR] linker: readlink('/proc/self/fd/54') failed: Permission denied [fd=54] 
[ERROR] linker: warning: unable to get realpath for the library "libRSDriver.so". Will use given name. 
[ERROR] linker: readlink('/proc/self/fd/54') failed: Permission denied [fd=54] 
[ERROR] linker: warning: unable to get realpath for the library "libRSCpuRef.so". Will use given name. 
[ERROR] linker: readlink('/proc/self/fd/54') failed: Permission denied [fd=54] 
[ERROR] linker: warning: unable to get realpath for the library "libblas.so". Will use given name. 

이 코드입니다 :

var intent = Ti.Android.createIntent({ 
     action: Ti.Android.ACTION_GET_CONTENT, 
     type: "application/pdf" 
    }); 

    var x = Ti.Android.createIntentChooser(intent, "Select"); 
    $.index.getActivity().startActivityForResult(x, function(e) { 
     try { 
      var doc = Ti.Filesystem.getFile(e.intent.data); 

    var xhr = Ti.Network.createHTTPClient({ 
     onload: function() { 
      var result = JSON.parse(this.responseText); 
      console.log("File uploaded successfully : ", result); 
     }, 
     onsendstream: __.sendstream, 
     onerror: function() { 
      console.error("Error in upload file : ", this.responseText); 
     }, 
     timeout: 100000000000000000000 
    }); 
    xhr.open("POST", URL); 
    xhr.send(doc); 

     } catch (error) { 
      console.error("This is error : " + error); 
     } 
    }); 

답변

0

어쩌면 그것은 때문에 저장 권한이다.

if (Ti.Filesystem.hasStoragePermissions()) 
{ 
    // app has storage permission 
} 
else 
{ 
    Ti.Filesystem.requestStoragePermissions(function(e) 
    { 
     if (e.success) 
     { 
      // permissions succesfully requested 
     } 
    }); 
} 
+0

가 이미 저장에 대한 권한을 가지고 내가 파일을 가지고 업로드 만 업로드 문제는 파일 이름 파일 이름에 있었다 – user2678165

+1

폐쇄의 OnError는 HTTP 복귀 후 아랍어에 있었다 수 있습니다

이 시도 내가 그것을 바꿀 때 lang은 요청 성공 – user2678165

관련 문제