Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize file without download it minio #19704

Closed
arian360 opened this issue May 9, 2024 · 1 comment
Closed

Visualize file without download it minio #19704

arian360 opened this issue May 9, 2024 · 1 comment

Comments

@arian360
Copy link

arian360 commented May 9, 2024

I'm utilizing Minio for file storage, and I want to view certain files directly from my browser without having to download them. I've attempted to generate a pre-signed URL for this purpose, but unfortunately, it still prompts for download. Here's the code snippet I used:

# Generate pre-signed URL with read access for 2 hours
url = MINIO_CLIENT.get_presigned_url(
    "GET",
    "example4-bucket",
    object_name,
    expires=timedelta(hours=2),
)
print("View URL for image.jpg:", url)
@harshavardhana
Copy link
Member

@arian360 that needs to be done via setting up correct content-type for the object so that the browser can invoke HTML5 primitives properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants