开发者

Access images in my IIS FTP site WITHOUT logging on?

I have a FTP Site using IIS 7.0. It is working just fine. I have just added a folder to the site, and put in some images. Our company has an email service, that sends out emails to our customers. I have set up links to some of these images so they will appear in these emails.

However, each time i try to open one of the emails now, i get the 'FTP Log On' window. I have the 开发者_如何学Pythonimages set up under Anonymous, so all i have to do, is leave it the username and password blank, and click 'Okay', and the box goes away. But, i do not want my customers to have to do this. Is there a way, to reference images contained in a ftp site, and have them autoload with the email, not asking for any log on info?

Thank you!!


I do not know if what you are asking is really possible, what you need to do is add the user and password on to the link, but that would not be my recommendation.

I would create a virtual directory on the ftp server, that would also point to a virtual directory on an IIS server (it is easy if you are running http on the same machine, and that machine is public). Then anything that was uploaded to the FTP, could be served via HTTP.

http://learn.iis.net/page.aspx/150/understanding-sites-applications-and-virtual-directories-on-iis-7/

I really think that is a better solution to the issue, since the ftp port might be blocked by the users reading the email, some browsing devices will not be smart enough to use FTP to get the image, etc. I think it would result in a lot of blocked/missing images in the email.


If you get an ftp login when you open the email, most likely you've embedded the images with an ftp://url, e.g.

<img src="ftp://yourserver.com/somepic.jpg" />

An HTML email would never resort to the FTP protocol to retrieve a URL unless FTP was explicitly specified - it would always default to HTTP otherwise.


You should be able to have a link that looks something like this:

ftp://user:password@myftp.com

Since you're using the anonymous profile with no password, this should work:

ftp://anonymous@myftp.com

This specifies what user it should try to sign in as and can optionally specify a password (if not specifying a password, leave out the semicolon). So image companylogo.jpg in folder Images would look like this in the HTML:

<img src="ftp://anonymous@myftp.com/Images/companylogo.jpg" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜