Giter VIP home page Giter VIP logo

tus-android-client's People

Contributors

abhishekbansal avatar acconut avatar cdr-chakotay avatar dependabot[bot] avatar encosw avatar felixge avatar ifedapoolarewaju avatar profahad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tus-android-client's Issues

error code 400

io.tus.java.client.ProtocolException: unexpected status code (400) while creating upload

Internal error (404) after server side remove the file.

I got an "Internal error (404)" when uploading the same file whether it completed or not.
http://postimg.org/image/rpnvhhyk7/
The server side already remove the file. It a reasonable error but which is not my expectation.

In my expectation, it shall be start a brand new file transmission if the file is not exist in the server without showing the error. Because it is reasonable in a scenario which server move the file to another directory / space or remove / delete the file and user wants to upload the same file. User does not know the server side is remove the file or not. Currently, users need to clean the App settings to solve this problem.

There exists another similar situation in my tests with server side already exist the file and client side uploaded the file once.
Currently implementations and sample codes is not allow user to upload the same file again unless user clean the App settings, too. It shall be start a new file upload session and stored with different file name in the server if previous file transmission is successful uploaded.

I known that these two situations are related to current resume file upload mechanism, but I think these two scenarios are very common in file uploading applications. So anyone have good ideas to handle these two scenarios?

Upload stuck after few seconds without showing error

Question
After a few seconds from the beginning of the video upload process, the progress bar stops without displaying any errors. Sometimes (when I debug my code and it stops on breakpoint) I got
ssl=0xc5934ed8: I/O error during system call, Broken pipe I try to solve this problem with #33
and
https://github.com/tus/tus-android-client#i-get-tlsssl-errors-on-older-android-versions
but without any success. For some reason, program never reach uploader.finish() or anything below that line of code (that is strange because do-while code is not in infinity loop).

Code sample:
`

            HashMap<String, String> headers = new HashMap<>();
            headers.put("Tus-Resumable", "1.0.0");
            headers.put("Authorization", getAuthHeader());
            headers.put("Accept", getAcceptHeader());
            headers.put("Content-Type", "application/offset+octet-stream");
            headers.put("Upload-Length", "" + upload.getSize());
            headers.put("Connection", "Keep-Alive");
            client.setHeaders(headers);

            TusUploader uploader = client.beginOrResumeUploadFromURL(upload, client.getUploadCreationURL());
            long totalBytes = upload.getSize();
            long uploadedBytes = uploader.getOffset();

            uploader.setChunkSize(1024);

            while (!isCancelled() && uploader.uploadChunk() > 0) {
                uploadedBytes = uploader.getOffset();
                publishProgress(uploadedBytes, totalBytes);
            }
            
            uploader.finish();
            return uploader.getUploadURL();

`
device-2020-05-18-130543

Setup details
Please provide following details, if applicable to your situation:

  • Runtime environment: [Android version 7]
  • Used tus-android-client version: [v0.1.9]
  • Used tus-java-client version: [ev0.4.2]

File extension is removing in server after uploading a file from android client

Tus - upload Bug:
File extension is removing in our server after uploading a file from android client. But no issue after uploading file from JS-client and tus client for iOS.
But file is uploading successfully and able to see correct file after successful upload of file to https://tusd.tusdemo.net/files/
Anything else need to do at server side or in Android code??

Setup details

  • Runtime environment: 27.0.3
  • Used tus-android-client version: v0.1.9
  • Used tus-java-client version: 0.4.2

Can anyone help me here?

unexpected status code (405) while creating upload

URL: https://files.tus.vimeo.com/files/vimeo-prod-src-tus-eu/83bb82bbb6073e56fae728ed53b322fb
Data : /data/user/0/com.XXXX/cache/temp1341568618.mp4

    TusClient client = new TusClient();
    try {
        client.setUploadCreationURL(new URL(link));

        InputStream inputStream = getActivity().getContentResolver().openInputStream(uri);
        File tempFile = File.createTempFile("temp", ".mp4");
        tempFile.deleteOnExit();
        FileOutputStream out = new FileOutputStream(tempFile);
        IOUtils.copy(inputStream, out);
        final TusUpload upload = new TusUpload(tempFile);

        Log.e("link",link+"");
        Log.e("tempFile",tempFile.getPath()+"");

        getActivity().runOnUiThread(new Runnable() {

            @Override
            public void run() {
                mProgress.setProgress(0);
                mViewProgress.setVisibility(View.VISIBLE);
                mHideView2.setVisibility(View.VISIBLE);
                mHideView1.setVisibility(View.VISIBLE);
            }
        });
        TusExecutor executor = new TusExecutor() {
            @Override
            protected void makeAttempt() throws ProtocolException, IOException {
                TusUploader uploader = client.resumeOrCreateUpload(upload);
                uploader.setChunkSize(1024);
                do {
                    long totalBytes = upload.getSize();
                    long bytesUploaded = uploader.getOffset();
                    double progress = (double) bytesUploaded / totalBytes * 100;
                    getActivity().runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            mProgress.setProgress((int) progress);
                        }
                    });
                } while (uploader.uploadChunk() > -1);

                uploader.finish();
                getActivity().runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        mViewProgress.setVisibility(View.GONE);
                        mHideView2.setVisibility(View.GONE);
                        mHideView1.setVisibility(View.GONE);
                    }
                });
            }
        };
        executor.makeAttempts();

    } catch (Exception e) {
        e.printStackTrace();
    }



}

The example should compare uploadChunk() against -1

https://github.com/tus/tus-android-client/blob/master/example/src/main/java/io/tus/android/example/MainActivity.java#L166 loops while(!isCancelled() && uploader.uploadChunk() > 0). However, according to https://github.com/tus/tus-java-client/blob/master/src/main/java/io/tus/java/client/TusUploader.java#L18 and https://github.com/tus/tus-java-client/blob/master/src/main/java/io/tus/java/client/TusUploader.java#L182, uploadChunk() may return 0 while the upload is not finished yet (for example, while the connection is down?).

Please fix the example to loop while(!isCancelled() && uploader.uploadChunk() > 1) instead.

> net::ERR_UPLOAD_FILE_CHANGED

          > net::ERR_UPLOAD_FILE_CHANGED

If I understand this error correctly, the file that you are uploading has been modified or changed and therefore Chrome throws an error because it must be selected by the user again. I do not think there is much that tus-js-client can do against it. Maybe it is also a bug in Chrome or the Google Drive app where they do not retain the file long enough for the upload to be completed.

Originally posted by @Acconut in tus/tus-js-client#255 (comment)

Tus resumable upload socket timeout exception occured

Caused by: android.system.ErrnoException: sendto failed: ECONNRESET (Connection reset by peer)
W/System.err: at libcore.io.Posix.sendtoBytes(Native Method)
W/System.err: at libcore.io.Posix.sendto(Posix.java:176)
W/System.err: at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:278)
W/System.err: at libcore.io.IoBridge.sendto(IoBridge.java:513)
W/System.err: ... 18 more
D/IO Exception ========: java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer)

Internal Error

I downloaded the android client and tried to run the app on my Samsung S3 (V 4.1) and it keeps giving the 400 internal error every time I click on abort and also when the upload is at 100%. This is happening on all pre-lollipop devices. How can I make it work?

New Version

There is a change waiting to be released on Master that uses Context in the TusAndroidUploader rather than Activity.

Could this be released as an artefact to JCenter?

Software casued connection abort while switching network

Describe the bug
Hello, i am facing strange issue while uploading file from android device using tus client. It gives "javax.net.ssl.SSLException: Write error: ssl=0xb400007824f03618: I/O error during system call, Software caused connection abort" exception

To Reproduce
Steps to reproduce the behavior:

  1. Start file upload using wifi connection
  2. Then switch network from Wifi to mobile network
  3. See error

Error
javax.net.ssl.SSLException: Write error: ssl=0xb400007824f03618: I/O error during system call, Software caused connection abort
at com.google.android.gms.org.conscrypt.NativeCrypto.SSL_write(Native Method)
at com.google.android.gms.org.conscrypt.NativeSsl.write(:com.google.android.gms@[email protected] (190400-455379205):3)
at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket$SSLOutputStream.write(:com.google.android.gms@[email protected] (190400-455379205):5)
at com.android.okhttp.okio.Okio$1.write(Okio.java:78)
at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:157)
at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:177)
at com.android.okhttp.okio.RealBufferedSink.write(RealBufferedSink.java:47)
at com.android.okhttp.internal.http.Http1xStream$ChunkedSink.write(Http1xStream.java:327)
at com.android.okhttp.okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:177)
at com.android.okhttp.okio.RealBufferedSink$1.write(RealBufferedSink.java:199)
at io.tus.java.client.TusUploader.uploadChunk(TusUploader.java:190)

Termiant or Abort

Question

  1. In tus android library , how we can terminate or abort a on going upload from client side ?
  2. While a upload is in process, when I try to send a delete request, i get response 423 file currently locked. How to resolve

Setup details
Please provide following details, if applicable to your situation:

  • Runtime environment: [e.g. Android version, etc.]
  • Used tus-android-client version: v0.1.10
  • Used tus-java-client version: v0.4.2
  • Used tus server software: tusd

Errors

I'm trying the example app and I continuously get 404 error or internal error...

TusAndroidUpload requires Activity instead of Context

The signature of the TusAndroidUpload is the following:
TusAndroidUpload(Uri uri, Activity activity)

Since the Activity itself is not used for anything but getting a ContentResolver from it, a Context could be used instead, thus relaxing the requirements for its usage.

OutOFMemory Error

Hello,

I am using tus-android-client to upload video files into our server. Upload process goes well for small size video files(eg. 50MB). But when I try to upload large files(eg. 500MB), I am getting outOfMemory error.

Note : I am using same code as described here.

Any help will be appreciated.

Thanks in Advance.

File Upload Failed

Hi I am facing the following exception while trying to upload File to tus server :

io.tus.java.client.ProtocolException: unexpected status code (423) while uploading chunk

Protocol Not found

Hi,

I got this issue
java.net.MalformedURLException: Protocol not found: //10.42.0.1:3400/files/b76560f995f57ab7c2a47b93519c272b
http removed automatically

While I have given http://10.42.0.1 i.e IP address of my local host
b76560f995f57ab7c2a47b93519c272b is the file name which is created when I hit the url.

Also, I changed the content type explicitly to application/offset+octet-stream
Please help.

Migration from Jcenter to MavenCentral

Please move dependencies to MavenCentral because JCenter is deprecated. My team would be very grateful for that.
You have already published 1.6.0 on MavenCentral. Please upgrade to 1.8.0 or newer
image

listener bytes uploaded of chunk

Hi
How to get uploaded bytes of any chunk ?

when I upload small file for example 5 MB , progress bar wait and 50 percent show

Status 308

Tried first running this against my own server (works with js uploader) and also with the master.tus.io test server, getting code 308 while creating upload error.

Is this example known working against that test instance?

Vimeo upload : unexpected status code (404) while resuming upload

Question
Hello,
I am trying to upload video on Vimeo with your library. I have upload access, I have PRO account, and I follow this tutorial (https://developer.vimeo.com/api/upload/videos). After I get {upload_link} from vimeo, I try to start video upload, so I select .mp4 file from storage via your example code, pass upload_link as link of UploadCreationURL in TusClient, and get error:
io.tus.java.client.ProtocolException: unexpected status code (404) while resuming upload.
Best regards.

Setup details

  • Runtime environment: [7.0.]
  • Used tus-android-client version: [e.g. v0.1.9]
  • Used tus-java-client version: [e.g. v0.4.1]
  • Used tus server software: [1.0.0]

Io Exception while uploading Video to Vimeo

I integrated Vimeo video upload in my android app and i am using Tus client to upload video to vimeo , sometimes upload works great but some time it is failed and Exception such as IOException, Broken Pipe raises every time

Additional unnecessary call if the file size is divisble by requestPayloadSize

Describe the bug
When trying to upload a file thats exactly divisible by requestPayloadSize. An additional empty PATCH request will be made that will result in 404.

The cause of it is that in uploadChunk() method you're finishing connection after bytesRemainingForRequest is reaching 0. uploadChunk() doesn't return -1 at this point.
On the server side the file is already "finished" since all bytes are there, but on the device an additional loop has to be made to receive -1 from uploadChunk(). But that additional call results in new connection being opened thats when being finished sends an empty body PATCH that results in 404 from the server, since for the server the upload already finished.

I guess a simple fix for that would be to move the openConnection() inside uploadChunk() a litte bit lower so that its called only if read didnt return -1

To Reproduce

  1. Follow the impl guide.
  2. Try to upload exactly 10MB file without changing any setup in uploader

Expected behavior
No additional call when theres nothing left to upload.

Setup details
Please provide following details, if applicable to your situation:

  • Any android version
  • tus-android-client v0.1.9
  • tus-java-client v0.4.2

Is tus android client compatible with spring boot server

Question
I am using a spring boot server and I have a android client through which I am trying to upload the images to my server. I have also configured my spring boot server for tus protocol.

But I get this error when I try to upload image from my android client:
io.tus.java.client.ProtocolException: unexpected status code (403) while creating upload

Setup details
Please provide following details, if applicable to your situation:

  • Runtime environment: Android 13
  • Used tus-android-client version: v0.5.0
  • Used tus-java-client version: 0.1.11
  • Used tus server software: tus-java-server

Getting this error now on line TusUploader uploader = client.resumeOrCreateUpload(upload);

03-28 14:15:02.567 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: io.tus.java.client.ProtocolException: unexpected status code (404) while creating upload
03-28 14:15:02.567 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: at io.tus.java.client.TusClient.createUpload(TusClient.java:151)
03-28 14:15:02.577 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: at io.tus.java.client.TusClient.resumeOrCreateUpload(TusClient.java:232)
03-28 14:15:02.577 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: at com.yourappsindia.dempabackuptesting.HomeActivity$4.makeAttempt(HomeActivity.java:225)
03-28 14:15:02.577 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: at io.tus.java.client.TusExecutor.makeAttempts(TusExecutor.java:83)
03-28 14:15:02.577 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: at com.yourappsindia.dempabackuptesting.HomeActivity.sendFile(HomeActivity.java:253)
03-28 14:15:02.577 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: at com.yourappsindia.dempabackuptesting.HomeActivity$5.onResponse(HomeActivity.java:325)
03-28 14:15:02.587 16311-16311/com.yourappsindia.dempabackuptesting W/System.err: at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)

My Configuration are as follows :
compile 'io.tus.java.client:tus-java-client:0.3.2'

And My Code are as below:

final TusClient client = new TusClient();

    // Configure tus HTTP endpoint. This URL will be used for creating new uploads
    // using the Creation extension
    try {
        String finalUrl = "my_Upload_Path";
        client.setUploadCreationURL(new URL(finalUrl));

    } catch (MalformedURLException e) {
        e.printStackTrace();
    }

    client.enableResuming(new TusURLMemoryStore());
    try {

        String yourFilePath = getExternalFilesDir(Environment.DIRECTORY_PICTURES) + "/default.jpg";
        File yourFile = new File(yourFilePath);
        upload = new TusUpload(yourFile);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }

    System.out.println("Starting upload...");

    TusExecutor executor = new TusExecutor() {
        @Override
        protected void makeAttempt() throws ProtocolException, IOException {
          
            TusUploader uploader = client.resumeOrCreateUpload(upload);

            // Upload the file in chunks of 1KB sizes.
            uploader.setChunkSize(1024);

            // Upload the file as long as data is available. Once the
            // file has been fully uploaded the method will return -1
            do {
                // Calculate the progress using the total size of the uploading file and
                // the current offset.
                long totalBytes = upload.getSize();
                long bytesUploaded = uploader.getOffset();
                double progress = (double) bytesUploaded / totalBytes * 100;

                System.out.printf("Upload at %06.2f%%.\n", progress);
            } while (uploader.uploadChunk() > -1);

            // Allow the HTTP connection to be closed and cleaned up
            uploader.finish();

            System.out.println("Upload finished.");
            System.out.format("Upload available at: %s", uploader.getUploadURL().toString());
         
        }
    };
    try {
        executor.makeAttempts();
    } catch (ProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

exception": "java.io.FileNotFoundException",

This error comes when I try to upload from the Android app folder.
ex:-
path:-storage/emulated/0/Android/data/com.myapp.name/files/Project/0830221053_full.mp4

 Uri uri = Uri.fromFile(new File("path"));
TusUpload upload = new TusAndroidUpload(uri, mContext);

I checked this file, this is the exists.

Upload don't resume instead restart from 0, when uploading to vimeo

I am having problem resuming upload when uploading to vimeo
here is the code i am using

  private Map<String, TusRunnable> executorsMap;
  private ExecutorService pool;

  public RNTusClientModule(ReactApplicationContext reactContext) {
    super(reactContext);
    this.reactContext = reactContext;
    this.executorsMap = new HashMap<String, TusRunnable>();
    pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
  }

  @Override
  public String getName() {
    return "RNTusClient";
  }

  @ReactMethod
  public void createUpload(String fileUrl, ReadableMap options, Callback callback) {
    String endpoint = options.getString("endpoint");
    Map<String, Object> rawHeaders = options.getMap("headers").toHashMap();
    Map<String, Object> rawMetadata = options.getMap("metadata").toHashMap();

    Map<String, String> metadata = new HashMap<>();
    for (String key : rawMetadata.keySet()) {
      metadata.put(key, String.valueOf(rawMetadata.get(key)));
    }
    Map<String, String> headers = new HashMap<>();
    for (String key : rawHeaders.keySet()) {
      headers.put(key, String.valueOf(rawHeaders.get(key)));
    }

    try {
      String uploadId = UUID.randomUUID().toString();
      TusRunnable executor = new TusRunnable(fileUrl, uploadId, endpoint, metadata, headers);
      this.executorsMap.put(uploadId, executor);
      Log.d(TAG, "CREATE UPLOAD " + uploadId);

      callback.invoke(uploadId);
    } catch (FileNotFoundException | MalformedURLException e) {
      callback.invoke((Object) null, e.getMessage());
    }
  }
  @ReactMethod
  public void resume(String uploadId, Callback callback) {
    TusRunnable executor = this.executorsMap.get(uploadId);
    if (executor != null) {
      Log.d(TAG, "on resume upload");

      pool.submit(executor);
      callback.invoke(true);
    } else {
      callback.invoke(false);
    }
  }

  class TusRunnable extends TusExecutor implements Runnable {
    private TusAndroidUpload upload;
    private TusUploader uploader;
    private String uploadId;
    private String uploadEndPoint;
    private TusClient client;
    private boolean shouldFinish;
    private boolean isRunning;

    public TusRunnable(String fileUrl, String uploadId, String endpoint, Map<String, String> metadata,
        Map<String, String> headers) throws FileNotFoundException, MalformedURLException {
      this.uploadId = uploadId;
      this.uploadEndPoint = endpoint;

      client = new TusClient();
      // client.setUploadCreationURL(new URL(endpoint));

      SharedPreferences pref = reactContext.getSharedPreferences("tus", 0);

      client.enableResuming(new TusPreferencesURLStore(pref));
      client.setHeaders(headers);

      upload = new TusAndroidUpload(Uri.parse(fileUrl), reactContext);
      upload.setMetadata(metadata);

      Log.d(TAG, "executor created");

      shouldFinish = false;
      isRunning = false;
    }

    protected void makeAttempt() throws ProtocolException, IOException {
      // uploader = client.resumeOrCreateUpload(upload);
      uploader = client.beginOrResumeUploadFromURL(upload, new URL(uploadEndPoint));

      uploader.setChunkSize(1024);
      uploader.setRequestPayloadSize(10 * 1024 * 1024);
      Log.d(TAG, "attempt upload " + uploader.getChunkSize());

      // do {
      // long totalBytes = upload.getSize();
      // long bytesUploaded = uploader.getOffset();
      // sendProgressEvent(totalBytes, bytesUploaded);
      // Log.d(TAG, "on uploadchunk");

      // } while (uploader.uploadChunk() > -1 && !shouldFinish);

      Timer progressTicker = new Timer();

      progressTicker.scheduleAtFixedRate(new TimerTask() {
        @Override
        public void run() {
          sendProgressEvent(upload.getSize(), uploader.getOffset());
        }
      }, 0, 500);

      do {
      } while (uploader.uploadChunk() > -1 && !shouldFinish);

      sendProgressEvent(upload.getSize(), upload.getSize());

      progressTicker.cancel();
      uploader.finish();
    }

    private void sendProgressEvent(long bytesTotal, long bytesUploaded) {
      WritableMap params = Arguments.createMap();

      params.putString("uploadId", uploadId);
      params.putDouble("bytesWritten", bytesUploaded);
      params.putDouble("bytesTotal", bytesTotal);

      reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(ON_PROGRESS, params);
    }

    public void finish() throws ProtocolException, IOException {
      if (isRunning) {
        shouldFinish = true;
      } else {
        if (uploader != null) {
          uploader.finish();
        }
      }
    }

    @Override
    public void run() {
      isRunning = true;
      try {
        makeAttempts();
        String uploadUrl = uploader.getUploadURL().toString();
        executorsMap.remove(this.uploadId);
        WritableMap params = Arguments.createMap();
        params.putString("uploadId", uploadId);
        params.putString("uploadUrl", uploadUrl);
        reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(ON_SUCCESS, params);
      } catch (ProtocolException | IOException e) {
        WritableMap params = Arguments.createMap();
        params.putString("uploadId", uploadId);
        params.putString("error", e.toString());
        reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(ON_ERROR, params);
      }
      isRunning = false;
    }
  }

Unexpected status code (400) while uploading chunk

When i try to upload video on cloudflare unable to upload it and get io.tus.java.client.ProtocolException: unexpected status code (400) while uploading chunk error.

To Reproduce
Steps to reproduce the behavior:

  1. Select video and upload it
  2. If uploaded then please upload same video and check

Expected behavior
We can upload duplicate video all time no restriction is required

Setup details

  • Used tus-android-client version: [e.g. :0.1.11]
  • Used tus-java-client version: [e.g. :0.5.0]

issue on kitkat version >> javax.net.ssl.SSLHandshakeException: No enabled protocols; SSLv3 is no longer supported and was filtered from the list

i'm have problem when use TusClient on kitkat versions 4.4 (API 19):
W/System.err: javax.net.ssl.SSLHandshakeException: No enabled protocols; SSLv3 is no longer supported and was filtered from the list W/System.err: at com.google.android.gms.org.conscrypt.NativeSsl.initialize(:com.google.android.gms@[email protected] (000300-239467275):6) W/System.err: at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(:com.google.android.gms@[email protected] (000300-239467275):4) W/System.err: at com.google.android.gms.org.conscrypt.KitKatPlatformOpenSSLSocketImplAdapter.startHandshake(:com.google.android.gms@[email protected] (000300-239467275)) W/System.err: at com.android.okhttp.Connection.upgradeToTls(Connection.java:146) W/System.err: at com.android.okhttp.Connection.connect(Connection.java:107) W/System.err: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294) W/System.err: at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)

how must i do ? i already make tslv2socketfactory, nosslv3 but not help me.
sorry for bad english.

OutOfMemory During large file upload

Hello,

I am facing problem when try to upload Large Video file(250MB approx). I am getting OutOfMemory exception after some time of upload start. Although this problem is not happening for small size files.
Below is the stack Trace

Caused by: java.lang.OutOfMemoryError: Failed to allocate a 536870924 byte allocation with 16773216 free bytes and 252MB until OOM

Any help is appreciated.

NullPointerException on connection.getHeaderField("Location")

Hi all,

I am trying the sample code of tus-android-client. I porting it to a HelloWorld sample project which copy all materials (layout and codes) from GitHub.
My server URL is set at onCreate method as below:

protected void onCreate(Bundle savedInstanceState) {
...
    client.setUploadCreationURL(new URL("http://211.78.245.94:1080/"));
...
}

When I running on my two Android smartphones (4.4.2 and 6.0.1), both of them get the error message as below:

04-11 17:57:48.130 22375-22375/com.example.helloworld W/System.err: java.lang.NullPointerException
04-11 17:57:48.130 22375-22375/com.example.helloworld W/System.err: at io.tus.java.client.TusClient.createUpload(TusClient.java:117)

public TusUploader createUpload(TusUpload upload) {
...
    String urlStr = connection.getHeaderField("Location");  // Line 117
    if(urlStr.length() == 0) {
        throw new ProtocolException("missing upload URL in response for creating upload");
    }
    URL uploadURL = new URL(urlStr);
...
}

It seems like the connection object cannot get Location this header field.

I solved this problem by mark codes as above and use codes as below:
URL uploadURL = connection.getURL();

And get another error message:

04-11 17:51:46.038 14065-14065/com.example.helloworld W/System.err: java.lang.NullPointerException
04-11 17:51:46.038 14065-14065/com.example.helloworld W/System.err: at io.tus.java.client.TusClient.resumeUpload(TusClient.java:172)

public TusUploader resumeUpload(TusUpload upload) {
...
    String offsetStr = connection.getHeaderField("Upload-Offset");  // Line 172
    if(offsetStr.length() == 0) {
        throw new ProtocolException("missing upload offset in response for resuming upload");
    }
...
}

It seems like not the Android OS version problem because two different OS version & device get the same error.
It may be the problem is this standard sample code or the server problem.

My server is operating using the tusd which written by Go (the official binary distribution from official web site) and the firewall is opened the port 1080.

Anyone have ideas about solving these two problems?

Not able to sync gradle

I included the gradle link in my build.gradle file
compile 'io.tus.android.client:tus-android-client:0.1.3'

But it is not syncing the required project
However the tus-java-client is successfully synced.

Can you please tell me whats the problem?

status code 301

io.tus.java.client.ProtocolException:` unexpected status code (301) while creating upload.

can you plz explain. why this happening??

W/System.err: io.tus.java.client.ProtocolException: unexpected status code (301) while creating upload W/System.err: at io.tus.java.client.TusClient.createUpload(TusClient.java:151) W/System.err: at io.tus.java.client.TusClient.resumeOrCreateUpload(TusClient.java:232)

How to clear the chunk cache or solve this problem?

If I select a new file to upload, everything works fine.
But then I select that file again (I've uploaded it before) and it fails to upload, crashes when calling uploader.finish()
Logs:

io.tus.java.client.ProtocolException: unexpected status code (400 or 500) while uploading chunk
17:55:09.578 System.err en....atech.vovnews W at io.tus.java.client.TusUploader.finishConnection(TusUploader.java:343)
17:55:09.579 System.err en....atech.vovnews W at io.tus.java.client.TusUploader.finish(TusUploader.java:321)
17:55:09.579 System.err en....atech.vovnews W at io.tus.java.client.TusUploader.finish(TusUploader.java:306)

I checked and found uploader.uploadChunk() = -1, before do do { ...} while(uploader.uploadChunk() > -1)

I thought clearing chunk cache might be a solution but I couldn't find that method.

Getting "response contains different Upload-Offset value" in example application

Hi, I'm currently trying to pin down a bug I'm getting using the example application. When I select a picture, and it gets to the end of the upload, the following error gets thrown:
D/Loop: Error occurred: response contains different Upload-Offset value (1386863) than expected (1391815) Error class: class io.tus.java.client.ProtocolException

So it seems like it is undershooting the number of bytes it needs to upload? This seems strange, and I haven't touched the code from the example application, so I don't know what's wrong. I should say that it did successfully upload on a few occasions, but this error happens 95% of the time!

PS I will be hunting this down as I can, I just felt like posting this to see if anyone had any ideas.

Edit: after some logging, I found it might be mixing up numbers?
D/Loop: Looped! 1391815/1386863 (uploaded/total)
D/Loop: Error occurred: response contains different Upload-Offset value (1386863) than expected (1391815) Error clasS: class io.tus.java.client.ProtocolException

Progress callback is limited on Android

On iOS we have a progress callback which is quite nice! On Android for the progress we are stuck with the chunk size (which will slow down the upload if its too small). Can we have a more responsive progress somehow?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.