diff --git a/compress/api_upload.go b/compress/api_upload.go index a2da667..5528565 100644 --- a/compress/api_upload.go +++ b/compress/api_upload.go @@ -143,15 +143,14 @@ func (o *compress) SetPublishedUpload(jobid int, published int) (*VideoUploadInf * upload file to compress * gets signed url from minio, uploads and finally creates the upload record. * @param {string} file +* @param {string} filename * @param {string} size * @param {int} categoryId * @param {string} title * @param {string} tags * @param {string} location -* @param {string} filename -* @param {string} targetFolder */ -func (o *compress) Upload(file []byte, size int64, categoryId int, title string, tags string, location string, filename string) (*ResponseUpload, error) { +func (o *compress) Upload(file []byte, filename string, size int64, categoryId int, title string, tags string, location string) (*ResponseUpload, error) { // respCustomerS3, err := o.GetCustomerS3Zone() if err != nil { @@ -163,7 +162,7 @@ func (o *compress) Upload(file []byte, size int64, categoryId int, title string, zone := respCustomerS3.Data.Zone o.debugPrint("zone ", zone) fmt.Println("bucketUpload: ", respCustomerS3.Data.BucketUpload, " zone ", zone) - bucketFolderDestination := NormalizeURL(respCustomerS3.Data.BucketUpload + filename) + bucketFolderDestination := NormalizeURL(respCustomerS3.Data.BucketUpload + "/" + filename) //o.debugPrint("bucketFolderDestination " + respCustomerS3.Data.BucketUpload) fmt.Println("bucketFolderDestination", bucketFolderDestination) // diff --git a/compress/compress.go b/compress/compress.go index e376dd5..01da189 100644 --- a/compress/compress.go +++ b/compress/compress.go @@ -16,7 +16,7 @@ type ICompress interface { GetSingleUpload(jobid int) (*VideoUploadInfo, error) GetJobidProgress(jobid int) (*VideoUploadInfo, error) SetPublishedUpload(jobid int, published int) (*VideoUploadInfo, error) - Upload(file []byte, size int64, categoryId int, title string, tags string, location string, filename string) (*ResponseUpload, error) + Upload(file []byte, filename string, size int64, categoryId int, title string, tags string, location string) (*ResponseUpload, error) //UploadMultipart(reader io.Reader, size int64, categoryId int, title string, tags string, location string, filename string, targetFolder string) (*ResponseUpload, error) // need to add this feature GetCategories() ([]Category, error) CreateCategory(name string) (*Category, error) diff --git a/test/api_upload_test.go b/test/api_upload_test.go index 5466521..4f68ab4 100644 --- a/test/api_upload_test.go +++ b/test/api_upload_test.go @@ -31,12 +31,12 @@ func TestUpload(t *testing.T) { response, err := c.Upload( fileContent, + stat.Name(), stat.Size(), 60678, "title", "tag", "", - filePath, ) //fmt.Print(response)