hubspot-net / HubSpot.NET

C# .NET Wrapper around the common HubSpot APIs.
MIT License
112 stars 137 forks source link

Error while uploading a file #87

Closed TDroogers closed 2 years ago

TDroogers commented 4 years ago

Describe the bug I am trying to upload a file to my dev environment.

Repro Steps I am using the following code byte[] btBuffer = File.ReadAllBytes(/*Correct path to file*/); FileHubSpotModel fhm = new FileHubSpotModel { File = btBuffer, Name = "demo", Hidden = false, Overwrite = false, FolderPaths = "demo", Type = ".csv" }; _HapiApi.File.Upload<FileHubSpotModel>(fhm);

I am not getting a usefull error: Error from HubSpot, JSONResponse=Empty

Expected behavior File should be uploaded.

Screenshots [16:06:03] [Error] HubSpot.NET.Core.HubSpotException: Error from HubSpot, JSONResponse=Empty at HubSpot.NET.Core.HubSpotBaseClient.ExecuteMultipart[T](String absoluteUriPath, Byte[] data, String filename, Dictionary`2 parameters, Method method) at HubSpot.NET.Api.Files.HubSpotCosFileApi.Upload[T](FileHubSpotModel entity)

*Anything else?** Other functions like getting and updating deals are working.

TDroogers commented 4 years ago

@Psypher9 could you look into my question? I have tried it with the latest version from github but I have other issues with that version, but could not solve those with the time on hand (I know it is not release ready, but I still wanted to give it a try).