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

nz-upload can't read cloudimage convert url, this url work with html img tag #5520

Closed
rockcoolt opened this issue Jul 6, 2020 · 4 comments · Fixed by #5525
Closed

nz-upload can't read cloudimage convert url, this url work with html img tag #5520

rockcoolt opened this issue Jul 6, 2020 · 4 comments · Fixed by #5525

Comments

@rockcoolt
Copy link

rockcoolt commented Jul 6, 2020

Reproduction link

https://stackblitz.com/edit/angular-24aycx-jltcez

Steps to reproduce

Use nz-upload with cloudimage convert url

What is expected?

nz-upload read cloudimage url

What is actually happening?

nz-upload can't read cloudimage url (html img tag can so, i think it's a bug)

Environment Info
ng-zorro-antd 9.2.2
Browser Chrome
@cipchk
Copy link
Member

cipchk commented Jul 7, 2020

Do you mean that fileList[1].url cna't be displayed? But what I see can be displayed:

png:

image

@rockcoolt
Copy link
Author

rockcoolt commented Jul 7, 2020

The 1st image can't be displayed
This:
{
uid: '-1',
name: 'image.png',
status: 'done',
url: 'https://admankdsen.cloudimg.io/v7/http://demo.cloudimg.io/v7/sample.li/satie2.pdf?w=800&force_format=jpg'
},

stackblitz updated

@cipchk
Copy link
Member

cipchk commented Jul 7, 2020

Yes, can't parse whether the image is valid for this type of address. but you can via nzPreviewFile
to fixed, pls refer to Customize preview file demo.

@rockcoolt
Copy link
Author

I have already try nzPreviewFile but, nzPreviewFile is called when the user add new image.
In my case is when i initialize nz-upload with nzFileList.
It don't work here :(

@cipchk cipchk added the 🐛 Bug label Jul 7, 2020
vthinkxie pushed a commit that referenced this issue Jul 9, 2020
- close #5520
- close #4990

`nzPreviewIsImage` 可以更好的自定义预览文件URL是否有效的图像格式,特别是一些CDN它们本身没有一个很明确的图像资源标识,比如:

- https://a.com/1.jpg 一种标准图像路径
- https://a.com/key?w=800&force_format=jpg 也算是一个有效的图像路径
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
- close NG-ZORRO#5520
- close NG-ZORRO#4990

`nzPreviewIsImage` 可以更好的自定义预览文件URL是否有效的图像格式,特别是一些CDN它们本身没有一个很明确的图像资源标识,比如:

- https://a.com/1.jpg 一种标准图像路径
- https://a.com/key?w=800&force_format=jpg 也算是一个有效的图像路径
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants