pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
3.97k stars 290 forks source link

[Bug]: Some files are still being uploaded #738

Closed Soapistic closed 5 months ago

Soapistic commented 5 months ago

What happened?

Some users have uploaded files using the UploadThign API and uploader, the database sets the url for those images as "C:\fakepath\nameofimage.png" for example. And when i check the status of the image on the dashboard, it says that it's still uploading. I think that the problem is in some users using some specific browsers like Opera, that allows them to upload a copied image.

What did you expect to happen?

I expected the image to be uploaded and have a real URL.

Version

(6.5.2)

Reproduction Steps

Open website. Copy an image from the internet. Upload image using Opera GX's in-built tool for uploading images.

Relevant log output

No response

Code of Conduct

markflorkowski commented 5 months ago

Are you able to share some filekeys of affected files? or your appId? Feel free to DM to me on discord (@markr) and I can take a look at the logs to see if we can narrow down the root cause 👍

Soapistic commented 5 months ago

Goal-PNG.png | imageUploader | 137.13KB | Mar 30, 2024, 11:55 PM the url : https://utfs.io/f/33055852-cd89-41eb-9e10-50d61f537f7c-tn3vcf.png This is just one example of many.

Here's my appid : 3vf9h92ckm

After digging, the issue is with some browsers that create a fakepath for fileuploads to protect their users (Browsers with the full pricacy setting on).

markflorkowski commented 5 months ago

@Soapistic

I just tried to repro this using Opera and the latest version of uploadthing and was able to upload files without any issues.

Is there a specific setting I need to turn on in opera so see this behavior?

Soapistic commented 5 months ago

@Soapistic

I just tried to repro this using Opera and the latest version of uploadthing and was able to upload files without any issues.

Is there a specific setting I need to turn on in opera so see this behavior?

It's not Opera but it's a security feature (Privacy & Settings -> Safe Mode) that prevents JavaScript from accessing the file's local full path. In Chromium for example, you need to turn on Safe Mode (under Privacy & Settings).

markflorkowski commented 5 months ago

Ah I misunderstood from your initial post. Will test with that setting later today when I am back at a computer

Soapistic commented 5 months ago

@markflorkowski You didn't misread it :) ! After some looking around, the issue wasn't with Opera itself but the settings i've used ! Hope to get back from you soon +1

markflorkowski commented 5 months ago

This setting? image

Still seems to upload fine :thinking:

markflorkowski commented 5 months ago

Closing for now since we cannot seem to reproduce this behavior and have not gotten any other reports. Feel free to reopen if you are able to find a consistent repro.