C
C#10mo ago
Lucas

blazor

I have a silly question, I'm uploading a file, but I need to collect the local route, for example "C:/test/users/home$"name archive"
16 Replies
viceroypenguin
viceroypenguin10mo ago
what do you mean "local route"
Lucas
LucasOP10mo ago
sorry, route of the folder on my computer where the file is
viceroypenguin
viceroypenguin10mo ago
you can't the browser doesn't share that information with the server
Lucas
LucasOP10mo ago
I have a route from an api, which I need to send the file that is on my computer, so it expects to receive the folder route along with the file name and format (image/png)
viceroypenguin
viceroypenguin10mo ago
no clue, sorry. there's some js magic, etc.
Lucas
LucasOP10mo ago
c#
</RadzenColumn>
<RadzenColumn SizeMD="6">
<RadzenImage Path="@profilePictureUrl" Style="width: 200px; height: 200px; object-fit: cover; border-radius: 50%;" />
<RadzenUpload Multiple="false"
Url="upload/single"
Accept="image/*"
Icon="upload"
ChooseText=""

>
<RadzenUploadHeader Name="x-upload-path" Value="cdn" />
</RadzenUpload>
</RadzenColumn>
</RadzenRow>
c#
</RadzenColumn>
<RadzenColumn SizeMD="6">
<RadzenImage Path="@profilePictureUrl" Style="width: 200px; height: 200px; object-fit: cover; border-radius: 50%;" />
<RadzenUpload Multiple="false"
Url="upload/single"
Accept="image/*"
Icon="upload"
ChooseText=""

>
<RadzenUploadHeader Name="x-upload-path" Value="cdn" />
</RadzenUpload>
</RadzenColumn>
</RadzenRow>
Lucas
LucasOP10mo ago
@viceroypenguin | 🦋🐧
No description
Lucas
LucasOP10mo ago
linkImg = C:/home/downloads/image.png exemple
viceroypenguin
viceroypenguin10mo ago
Sorry, but I don't know. there's some javascript you can do in order to share the image file name, but i dont' know what that is.
Pobiega
Pobiega10mo ago
.. why do you need the path? iirc the client does send a suggested filename but the absolute path, why on earth would you need this? that path doesnt exist on the server, so its useless to you
Lucas
LucasOP10mo ago
@Pobiega to upload the file, Meta (Whatsapp) requests that it be like this
Pobiega
Pobiega10mo ago
https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media/#upload-media Thats because that API doesnt take the actual file itself, as far as I can see meaning there is no file being uploaded - it just passes the path and something else takes care of actually reading and uploading the file content
Lucas
LucasOP10mo ago
ahhhhhhh, thanks bro
Pobiega
Pobiega10mo ago
Im really not sure what that thing is thou, but look at those example queries
curl -X POST 'https://graph.facebook.com/v19.0/<MEDIA_ID>/media' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-F 'file=@"2jC60Vdjn/cross-trainers-summer-sale.jpg"' \
-F 'type="image/jpeg"' \
-F 'messaging_product="whatsapp"'
curl -X POST 'https://graph.facebook.com/v19.0/<MEDIA_ID>/media' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-F 'file=@"2jC60Vdjn/cross-trainers-summer-sale.jpg"' \
-F 'type="image/jpeg"' \
-F 'messaging_product="whatsapp"'
there is no file content here
Lucas
LucasOP10mo ago
he accepted link thanksssssssssssssssssssss
Pobiega
Pobiega10mo ago
okidoki
Want results from more Discord servers?
Add your server