Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2004, 06:12 AM
Registered User
 
Join Date: May 2004
Location: Kansas City, MO, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Save the Confirmation Page as a file

We have created a online PO form for a paperless office. The Document management people would like to store a image of each po. I have software that will convert from a html file to a jpg file.

Is it possible to automaticly save each of my po confirmation pages as a html file before or after I add the info to my database?

Thanks,
David

 
Old May 12th, 2004, 06:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

what is the client tool and the backend (DB server) that you use?

Can you explain this in detail a bit?

-Vijay G
 
Old May 12th, 2004, 06:21 AM
Registered User
 
Join Date: May 2004
Location: Kansas City, MO, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using an order.asp page that posts to order_ex.asp

The data on the form goes into an Access 2000 database.

david

 
Old May 12th, 2004, 06:24 AM
Registered User
 
Join Date: May 2004
Location: Kansas City, MO, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The order_ex.asp displays a "thank you for submitting the following info" confirmation page.

This is the page that I would like to save as a file on the server.

david

 
Old May 12th, 2004, 07:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

<%
if Request.Form("SUBMIT")="SaveasHTML" then
  Response.AddHeader "Content-Disposition", "attachment;filename=report.html"
  Response.ContentType = "text/html"
' Response.AddHeader "Content-Disposition", "attachment;filename=report.xls"
' Response.ContentType = "application/vnd.ms-excel"

end if
%>

<html>
<head>
<title>HTML save Testing</title>
</head>
<body>
<Form name="frmsave" action="savefile.asp" method="post">
<table width="50%" cellpadding="0" cellspacing="0" border="1">
     <tr>
          <td>test1</td>
          <td>test2</td>
          <td>test3</td>
          <td>test4</td>
          <td>test5</td>
     </tr>
     <tr>
          <td>test6</td>
          <td>test7</td>
          <td>test8</td>
          <td>test9</td>
          <td>test10</td>
     </tr>
     <tr>
          <td>test11</td>
          <td>test12</td>
          <td>test13</td>
          <td>test14</td>
          <td>test15</td>
     </tr>
     <tr>
          <td>test16</td>
          <td>test17</td>
          <td>test18</td>
          <td>test19</td>
          <td>test20</td>
     </tr>
     <tr>
          <td>test21</td>
          <td>test22</td>
          <td>test23</td>
          <td>test24</td>
          <td>test25</td>
     </tr>
     <tr>
          <td><INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="SaveasHTML" onsubmit="SaveasHTML"></td>
     </tr>
</table>
</form>
</body>
</html>

Is this what you wanted?

-Vijay G
 
Old May 12th, 2004, 11:17 AM
Registered User
 
Join Date: May 2004
Location: Kansas City, MO, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That works!

However I need the filed to be saved on the server without the users having to response to a msgbox?

I need the info in the file and I don't want to have to depend on a users doing the save correctly.

Thanks,
David

 
Old May 13th, 2004, 06:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi David,

The dialog box popping out to get info about the path where you would save the file is default behaviour of the browser. I am not sure if that can be by-passed. Let me try that out and post you on that if I find something useful.

Instead I would suggest you to use "Scripting.FileSystemObject" to store the file in a the location where you would want it to be. But the data from the FORM fields should be formated the way you would want it to be, before storing it into the file. FSO is the better option for that, as you didnot want the user to intervent while saving the file. This object lets you create a file at a location specified and write content into it all done through scripting and you would not find any such popup windows as you see in the earlier post.

But I am not sure what your requirement is and if that suits you.

Let us know, if you need more clarifications.

Hope that helps.
Cheers!

-Vijay G
 
Old May 13th, 2004, 08:06 AM
Registered User
 
Join Date: May 2004
Location: Kansas City, MO, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Am I correct in thinking with FSO I can only save as a text file?

david

 
Old May 13th, 2004, 08:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes you are right, But you can HTMLize your data through your program in a way you wanted.

After all these discussions, I am really curious to know the purpose of saving it to HTML?

-Vijay G




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save an web page content into RTF/text file khatu_jec ASP.NET 2.0 Professional 4 November 27th, 2007 04:52 AM
How can I save Crystal Report File to Image File? Muhammad Akbar Crystal Reports 0 July 10th, 2007 05:33 PM
Save PDF file as text file in VB.Net kvenkatu Classic ASP Basics 0 April 7th, 2006 01:09 PM
save a PDF file as text file through VB. NET kvenkatu VB.NET 0 April 6th, 2006 12:15 PM
avoid getting save confirmation on button click sansircar .NET Framework 1.x 1 February 1st, 2006 12:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.