claudiodangelis / qrcp

:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.
https://qrcp.sh
MIT License
9.96k stars 529 forks source link

文件后缀变化/file name ext-name changed?? #305

Closed ilaoyao closed 10 months ago

ilaoyao commented 10 months ago

I'm opening this issue because:

[+] I have found a bug windows终端扫描二维码,文件的时候,很多类型传输到手机上后,文件的后缀变成了txt(如exe,cmd);一些类型文件能保留(如zip等);

When the Windows terminal scans the QR code and files, after many types of files are transferred to the mobile phone, the suffix of the file becomes txt (such as exe, cmd); some types of files can be retained (such as zip, etc.) How can I keep the original file name ext-name unchanged?

THX!!

claudiodangelis commented 10 months ago

Hello! The tool creates a zip archive only when sending more than one file per transfer. Is this your case?

Thanks! Claudio

ilaoyao commented 10 months ago

Hello! The tool creates a zip archive only when sending more than one file per transfer. Is this your case?

Thanks! Claudio

no, when I try to transfered a single file from my windows PC (eg. d:\001\002.cmd), when I used a phone to scan the QR code and received a file name 002.txt). but it;s not all files will be like this. if the file's ext-name just like .zip, .iso,.pdf..., it will transfered with the orignal ext. .cmd, .apk and some other's type will be changed to .txt automatic.

upload screentshot pics.... 00

aff0cb3c0cd4c31e446c7817bd996ec

26c4ccd6056e96d61b80357dbe25d71

ps. multi-files and a folder will be created a zip-file, it's right! at last. thx ur great job. it's amazing....

ilaoyao commented 10 months ago

Hello! The tool creates a zip archive only when sending more than one file per transfer. Is this your case?

Thanks! Claudio

In addition, when I discussed this issue with my friends, we all agreed that this is set up for security reasons, such as unknown apk files are unknown risks to Android. But is it possible to add a parameter or a switch to set the file suffix not to be modified?

002

ilaoyao

claudiodangelis commented 10 months ago

Ah, thanks for providing more context. Yes, I would agree this is a security measure implemented by the browser.

Maybe you can add the --zip flag when sending, so once you receive the file you will just unzip it on the mobile, it should be smoother than replacing the extension manually.

Let me know if this helps, and thanks for the feedback! C

ilaoyao commented 10 months ago

yes, --zip flag can make ot right, and i test this way already.

i just wonder, in your codes, i don't find any line about to change the send-file's ext-name change to .txt, only in page.go i can see your code add .txt to non-ext-name file.

sincerely ilaoyao

claudiodangelis commented 10 months ago

Hello, I will close this issue for now as this is not something we have control over. Thanks for reporting!