经典 ASP:将 PDF 文件的内容发布到 .NET 页面
所以问题是应用程序一半是用经典 asp 编写的,一半是用 asp.net 编写的。 有一个由经典 asp 代码生成的 PDF 文件(在内存中),我需要与 .NET 部分共享。 我想过将 PDF 保存到 FS 或 DB,我很确定你们大多数人都不会推荐,因为它需要经历一个非常缓慢的保存到 IO 的过程,然后我需要在之后手动清理——不必要地制造更多瓶颈和故障点。
我想通过使用 Server.Transfer 或 Microsoft.XMLHTTP 对象来模仿从经典 asp 页面到 .NET 的帖子,但这两种方法都不完全符合场景,因为我确实希望客户端上的 URL 指向 .NET aspx页。 那么是否有一种简单的方法来制作从经典 ASP 到嵌入 PDF 文件的 .NET 页面的 POST?
预先感谢您的任何意见或建议。
So the problem is half the app is written in classic asp and half is in asp.net. There's a PDF file (in memory) that is generated by classic asp code that I need to share with the .NET half. I thought of saving the PDF to the FS or DB, which I am pretty sure most of you wouldn't recommend because it would need to go through a very slow process of saving to IO, and then I would need to manually clean up after -- unnecessarily creating more bottlenecks and failure points.
I thought of mimicking a post from the classic asp page to .NET by using Server.Transfer or Microsoft.XMLHTTP objects, but neither exactly fits the scenario as I really do want the URL on the client side to be pointing at the .NET aspx page. So is there a simple way to manufacture a POST from classic ASP to a .NET page with a PDF file embedded?
Thanks in advance for any comments or suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有点像黑客,但是...
在经典 ASP 中创建一个表单,其中包含一个字段,您可以使用 PDF 文件中的数据填充该字段。 表单的操作将是 ASP.NET 页面。 类似于:
您可能需要先对二进制 PDF 数据进行编码,然后再将其写入表单字段(Base64 或其他内容)。
Somewhat of a hack, but...
Create a form in classic ASP with a field that you populate with the data from the PDF file. The action of the form would be the ASP.NET page. Something like:
You might need to encode the binary PDF data prior to writing it to the form field (Base64 or something).
考虑到 ASP.NET 和 ASP 交互的困难,您最好的选择可能是 FS 或 DB。 这是我的“阻力最小的路径”。
Your best bet is probably the FS or DB considering the difficulties ASP.NET and ASP interaction. That's my "path of least resistance".
只需将其写入磁盘,将文件名存储在 cookie 或查询字符串中,然后 Response.Redirect 用户即可。 它可能“足够快”,并且比编写一个可通过 TCP 访问它们的最小公分母状态服务器要容易得多——这是我能想到的唯一的内存方式。
Just write it to disk, store the filename in a cookie or querystring, and Response.Redirect the user. It's likely to be "fast enough" and much easier than writing a least common denominator State Server accessible over TCP to both of them - which is the only in memory way of doing I can think of.