2010-07-11 00:06
浏览 34


I'm using Zend Mail library to access email and download email attachments. Is there a way to determine the attachment's filesize before downloading?

图片转代码服务由CSDN问答提供 功能建议

我正在使用Zend Mail库来访问电子邮件和下载电子邮件附件。 有没有办法在下载之前确定附件的文件大小?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dqxyh48864
    dqxyh48864 2010-07-11 02:40

    You don't say how you are 'downloading' it. There are many ways to receive an email. The simplest three are:

    1. SMTP - No, there is no way,
    2. POP3 - I think servers typically provide size of the total email, not sure, and
    3. IMAP - I really don't recall

    The answer is in the protocol you are using to retrieve (download). If you don't know that, at least you should know the PHP function you're using, so you should mention that.

    点赞 评论
  • duanliao3826
    duanliao3826 2010-07-11 00:22

    Have you taken a look at PHP's filesize(); function?

    It prints the file size in bytes but obviously you can convert it to whatever you want!

    点赞 评论