Image Upload - PUT api/personal/profile #728
-
Can anyone tell me what I should supply to image.data for the endpoint PUT api/personal/profile? I tried this: image: but subsequently got this result: imageUrl:"Files/Images/ApplicationUser/Screenshot20220616at15.35.46.png.png" Is an encoded string the correct thing for data? Also, am I missing some config, because the returned url is incorrect? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
You shouldn't include the extension in the "name" property. Other then that, it looks good. |
Beta Was this translation helpful? Give feedback.
-
Okay, so I uploaded the image correctly. But Fullstackhero is not configured out of the box to serve the saved location 'Files/Images/ApplicationUser'? Do I need to manually configure this myself in .UseStaticFiles ? Maybe as outlined here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-6.0 |
Beta Was this translation helpful? Give feedback.
-
The whole "Files" folder should be served. Configuration is done here: |
Beta Was this translation helpful? Give feedback.
You shouldn't include the extension in the "name" property. Other then that, it looks good.