English 中文(简体)
我如何从单独网页上收回一个文本文档和一个错误记录。
原标题:How can I return a text file and an error log from a webpage separately
  • 时间:2010-09-12 13:16:22
  •  标签:
  • forms
  • cgi

我有一份从指挥线操作的每字母文字,生成一份附有具体格式的数据文本档案,供另一个应用程序使用。 文字还印刷了有关梯子的信息警告信息。 为此,我撰写了一个网站。 在用户点击相关表格提交的理想世界中,将在浏览器上展示一页,其中包含信息信息信息,同时,浏览似乎允许用户将数据文本存档到磁盘上。 我愿在不打字的情况下就浏览器开展工作,因此,我认为我所希望的完全是不可能的。

我看到的一些网站处理这类问题,用信息信息显示该网页,并将下载的文档显示link<>。 这似乎意味着必须储存档案和进行某种安全分类,以便另一个用户不能下载你的档案(而不是说这是有关申请的一件大事)。

我不禁要问,是否有更明智的办法处理这一问题? e.g 能否用多部分信息来回两部分信息? 能否在不使用javascript的情况下用电文播下第二个窗口? 如果这些问题似乎像基本问题一样,则道歉——我的方案拟订知识属于DNA序列操纵算法,而不是网页生成。

最佳回答

如果(而且只有)数据能够迅速而容易生成,那么数据就一度用于错误信息,二次下载。 错误主题页的链接或带将重新产生结果,并迅速下载。

这是一种黑板,因为如果用户在下载链上打上之前对数据进行根本改动,你需要考虑做些什么。 谨慎地将头盔定在文件下载和正常网页上,例如,

if($submit) { 
    print header(-type=> application/octet-stream ,
         -Content_disposition=> attachment; filename=foobar.dat );
    Gen_Results();
}

坦率地说,我只是用了一点小script子,因为现在它只是一个非常安全的假设。 否则,使用某种替代物的“规范”。

问题回答

暂无回答




相关问题
C# Form Problem: new form losing control and randomly hiding

I m encountering strange behavior with forms on a c# 3.5 app. On a button click, my form1 hides itself, creates a new form2, and shows form2. Form1 also contains the event method triggered when ...

TCPlistener.BeginAcceptSocket - async question

Some time ago I have payed to a programmer for doing multithread server. In the meantime I have learned C# a bit and now I think I can see the slowndown problem - I was told by that guy that nothing ...

RoR: before_save on nested object in form?

I have a form with a nested object (customer < order), and it works except that it keeps creating a new customer record. I d like to have it check to see if an existing customer is already ...

Receive POST from External Form

I have a form on another website (using a different backend) that I want to be able to POST to my Rails application (on a different domain). How do I generate a valid authenticity token for the ...

Getting posted values in MVC PartialView

I ve created a PartialView which I render with Html.RenderPartial, passing the name of the view and the strongly-typed data item to bind to (below): <% Html.RenderPartial("...

Recaptcha - Form Customization

Does anyone know if recaptcha can be fully customize without the default frame. I need the recaptcha image to only be a certain width as well as the input field. Has anyone done this before with ...

Better way to retain form data on manual back redirect?

I have a form that, on submit, requires the customer to look over the data, and then confirm the changes before saving the data. However, I m using a really rough way of retaining data if the user ...