@@ -88,7 +88,12 @@ public static string UploadAFile(string filePath, string id, int gameId, Action<
8888 }
8989
9090 var eventId = Guid . NewGuid ( ) . ToString ( ) ;
91- ServerRequest . UploadFile ( endPoint . endPoint , endPoint . httpMethod , System . IO . File . ReadAllBytes ( filePath ) , formData , ( serverResponse ) =>
91+
92+ string [ ] splitFilePath = filePath . Split ( new char [ ] { '\\ ' , '/' } ) ;
93+ string defaultFileName = splitFilePath [ splitFilePath . Length - 1 ] ;
94+
95+ ServerRequest . UploadFile ( endPoint . endPoint , endPoint . httpMethod , System . IO . File . ReadAllBytes ( filePath ) , defaultFileName ,
96+ body : formData , onComplete : ( serverResponse ) =>
9297 {
9398 UploadAFileResponse response = new UploadAFileResponse ( ) ;
9499 if ( string . IsNullOrEmpty ( serverResponse . Error ) )
@@ -105,7 +110,7 @@ public static string UploadAFile(string filePath, string id, int gameId, Action<
105110 response . Error = serverResponse . Error ;
106111 onComplete ? . Invoke ( response ) ;
107112 }
108- } , useAuthToken : true , isAdminCall : true ) ;
113+ } , useAuthToken : true , callerRole : enums . CallerRole . Admin ) ;
109114
110115 return eventId ;
111116 }
@@ -134,7 +139,7 @@ public static void GetFiles(FileFilterType filter, Action<GetFilesResponse> onCo
134139 response . Error = serverResponse . Error ;
135140 onComplete ? . Invoke ( response ) ;
136141 }
137- } , useAuthToken : true , isAdminCall : true ) ;
142+ } , useAuthToken : true , callerRole : enums . CallerRole . Admin ) ;
138143 }
139144
140145 public static void DeleteFile ( string fileId , Action < DeleteFileResponse > onComplete )
@@ -158,7 +163,7 @@ public static void DeleteFile(string fileId, Action<DeleteFileResponse> onComple
158163 response . Error = serverResponse . Error ;
159164 onComplete ? . Invoke ( response ) ;
160165 }
161- } , useAuthToken : true , isAdminCall : true ) ;
166+ } , useAuthToken : true , callerRole : enums . CallerRole . Admin ) ;
162167 }
163168
164169 public static void UpdateFile ( string fileId , UpdateFileRequest request , Action < UpdateFileResponse > onComplete )
@@ -183,7 +188,7 @@ public static void UpdateFile(string fileId, UpdateFileRequest request, Action<U
183188 response . Error = serverResponse . Error ;
184189 onComplete ? . Invoke ( response ) ;
185190 }
186- } , useAuthToken : true , isAdminCall : true ) ;
191+ } , useAuthToken : true , callerRole : enums . CallerRole . Admin ) ;
187192 }
188193
189194
0 commit comments