Welcome to the Panopto Community

Please note: All new registrants to the Panopto Community Forum must be approved by a forum moderator or admin. As such, if you navigate to a feature that is members-only, you may receive an error page if your registration has not yet been approved. We apologize for any inconvenience and are approving new members as quickly as possible.

I am trying to upload to panopto using aws s3 sdk (java).

sy ksy k Tyro

The first step to upload a file to Panopto is
The following response was received through the session upload API.
{
"ID": "7****bfd****--493f-****-b1abddf3",
"UploadTarget": "https://****.ap.panopto.com/Panopto/Upload/3ff6-507c--b78b-b13bddf3",
"FolderId": "f4c3-c**0--bedf-b17f0d83",
"SessionId": null
}
When setting up the S3 client
I think I need to use the "UploadTarget" value for the endPoint, regionName, bucketName, keyName, accessKey, and secretKey values, but I don't know the exact way.
//S3 Client setting code
final AmazonS3 s3 = AmazonS3ClientBuilder.standard()
            .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endPoint, regionName))
            .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
            .build();

//S3 upload code
s3.putObject(bucketName, keyName, new File(filePath));

Answers

  • Kevin BaumKevin Baum Panopto Employee

    Hello,

    The UploadTarget does become part of the file key that you'll send in the upload request, but it's usually just the GUID at the end that you'll need. The other parts of the UploadTarget (the "https://[hostname]/Panopto") will be used as part of the endpoint configuration.

    We do use a similar protocol to the AWS S3 client, but the uploads are still generally going to the Panopto site, and not direct to AWS's S3 storage. Because of this, the authentication and the endpoint are built a little bit differently.

    I don't have a Java example, but have you looked at our C# example ( https://github.com/Panopto/SessionUploadExample/blob/master/SessionUploadExample/Common.cs )? This file specifically contains the code we use to upload part of a video to Panopto using the S3 SDK and the Panopto Session Upload API. The code should be similar to what you would use in Java.

    Please take a look at our sample and see if that helps. We also have a Python sample that's built in a similar fashion if that helps ( https://github.com/Panopto/upload-python-sample/blob/master/simplest/panopto_uploader.py ).

    If you have any other questions, or need any help with the samples please let me know.

    Thanks,

    Kevin

Sign In or Register to comment.