大虾们好 
     我有个疑问很着急,因为苹果机无法兼容activx插件,所以我的文件下载没用,在线等大家帮我个解决方法,我的下载方法是用的文字流的方式,qq47874687

解决方案 »

  1.   

    文件下载 需要插件吗?
    比如你在IIS目录下放一个TXT文件,下载就是 http://ip/目录/文件名  就能下载了
      

  2.   

    按道理说是这样,但是我上传的时候也是以文件流的形式上传的,我用的是activx插件去下载的,
      

  3.   

    你只需要在服务端生成文件即可
    或者
    Asp.net 可以在页面中直接输出文件流
      

  4.   

    public void DownloadAttachment(Page p, int NewsID, string AttID)  ////字符流方式下载文件        {
                try
                {
                    NewsAttachment newsAttachment = this.GetNewsAttachment(AttID);
                    string text = ConfigurationSettings.AppSettings["DataDir"];
                    object obj2 = text;
                    FileStream stream = File.OpenRead(string.Concat(new object[] { obj2, @"news\", NewsID, @"\" }) + newsAttachment.AttID);
                    byte[] buffer = new byte[stream.Length];
                    p.Response.ContentType = "application/x-msdownload";
                    p.Response.AddHeader("Content-Disposition", "attachment; filename=\"" + FileService.EncodeFileNameForDownload(newsAttachment.AttFileName) + "\"");
                    stream.Read(buffer, 0, (int) stream.Length);
                    p.Response.BinaryWrite(buffer);
                    stream.Close();
                }
                catch (Exception exception)
                {
                    LogService.Write("NewsMgr:DownloadAttachment()");
                    LogService.Write(exception.ToString());
                }
            }这个是我的,调用的时候是这样写的
    function DownloadAtt(AttID, NewsID)
    {
    UploadTool.DownloadFrom('http://<%=Request.ServerVariables["SERVER_NAME"]%>/news/download.aspx?attid=' + AttID + '&nid=' + NewsID);
        
    }uploadtool调用了activx插件
      

  5.   

    你问了半天都没有讲为什么必须要用 activx插件完全不需要的事情,过去用了,只能说用错了
      

  6.   

    你直接在IE里打开 http://<%=Request.ServerVariables["SERVER_NAME"]%>/news/download.aspx?attid=' + AttID + '&nid=' + NewsID
    看看