I need to transfer document utilizing java kaltura api


#1

I need to transfer document utilizing java kaltura api. I have searched it about a great deal, But couldn’t discover any helping docs. If it’s not too much trouble encourage me in the event that anyone realizes how to transfer document in kaltura using java.

I got a C# API for file upload,i hope it will help you.

KalturaClient  kalturaClient = KalturaUtilsService.getKalturaClient();
            KalturaMediaEntry kalturaMediaEntry = new KalturaMediaEntry();


            kalturaMediaEntry.name = "Java Entry Using C#";
            kalturaMediaEntry.mediaType = KalturaMediaType.VIDEO;
            kalturaMediaEntry = kalturaClient.getMediaService().add(kalturaMediaEntry);
            FileStream fileStream = new FileStream("/home/alok/Desktop/index.mp4", FileMode.Open, FileAccess.Read);
            KalturaUploadToken uploadToken = kalturaClient.UploadTokenService.Add();
            kalturaClient.UploadTokenService.Upload(uploadToken.Id, fileStream);

            KalturaUploadedFileTokenResource mediaResource = new KalturaUploadedFileTokenResource();
            mediaResource.Token = uploadToken.Id;
            kalturaMediaEntry = kalturaClient.MediaService.AddContent(kalturaMediaEntry.Id, mediaResource);

Thanks & Regards,
Sailaxmi
MSBI Developer


#2

Hi @sailaxmi,

I’m afraid I’m not sure what you mean by “transfer a document”. Please reiterate.
Generally speaking, the best resource for working with the Kaltura API is developer.kaltura.com.
In addition to documentation, the site also features an interactive console that allows you to submit API requests without writing any code at all. It can also generate code to be used with all our API client libraries.