上传时如何检查图像是否为.tif [英] How do i check image is .tif while uploading

查看:91
本文介绍了上传时如何检查图像是否为.tif的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要上传.tif图像.我如何通过将.exe文件的扩展名更改为.tif来验证可以上传.exe文件的某人的上传,因此可以避免在vb.net中发生此类攻击.
谢谢..

I want to upload .tif images .how do i validate the upload from some one who can upload .exe file by changing its extension to .tif.Is any way to avoid such attack in vb.net.
thank you..

推荐答案

TIFF可以通过窥视第一个字节
TIFF can be detected by peeking at first bytes http://local.wasp.uwa.edu.au/~pbourke/dataformats/tiff/

The first 8 bytes forms the header. The first two bytes of which is either "II" for little endian byte ordering or "MM" for big endian byte ordering.


这篇关于上传时如何检查图像是否为.tif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆