How can I make this script/component accept server side rather than client side files

I'll start by telling you what I have now...

My web page (using a Persits AspPDF.NET component) accepts PDF uploads and then processes those individual documents by stitching them together - forming a single PDF file.  This works flawlessly and, in fact, is precisely what I was looking for - almost.  You can view my bare bones page at: http://www.mulehide.com/downloads/data_sheets.aspx

Now, what I want to do is, rather than the PDF's coming through as uploads, I want them to come through from a previous page and be posted to this page, then perform the stitch operation.  Basically, I want to do the same thing but instead, select PDF's that are already on my web server, rather than off the clients machine.  I tried a couple of different methods and failed miserably due to knowing absolutely nothing about VB code.  And I mean nothing!

Ideally the previous page would have say, checkboxes, allowing the visitor to select the PDFs theyd like to combine.  These would then submit the page and create the stitched PDF.  Even cooler would be to have everything on one page.

Any ideas out there?  Code is attached. Thanks!

Steve
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="Persits.PDF" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mule-Hide Data Sheets</title>
<script runat="server" language="vb">
Sub Page_Load(Source As Object, E As EventArgs)
    txtResult.Text = ""
 
	If Not IsPostBack Then Exit Sub
 
	Dim objFile1 As HttpPostedFile = MyFile1.PostedFile
	Dim objFile2 As HttpPostedFile = MyFile2.PostedFile
	Dim objFile3 As HttpPostedFile = MyFile3.PostedFile
	Dim objFile4 As HttpPostedFile = MyFile4.PostedFile
    
    Dim objPdf As PdfManager = New PdfManager()
    
    Dim FileBytes1 As Byte() = New Byte(objFile1.InputStream.Length){}
    objFile1.InputStream.Read( FileBytes1, 0, FileBytes1.Length )
 
    Dim FileBytes2 As Byte() = New Byte(objFile2.InputStream.Length){}
    objFile2.InputStream.Read(FileBytes2, 0, FileBytes2.Length)
 
    Dim FileBytes3 As Byte() = New Byte(objFile3.InputStream.Length){}
    objFile3.InputStream.Read(FileBytes3, 0, FileBytes3.Length)
 
    Dim FileBytes4 As Byte() = New Byte(objFile4.InputStream.Length){}
    objFile4.InputStream.Read(FileBytes4, 0, FileBytes4.Length)
    
    Try
        Dim objMasterDoc As PdfDocument = objPdf.CreateDocument()
 
        Dim objDoc1 As PdfDocument = objPdf.OpenDocument(FileBytes1)
        Dim objDoc2 As PdfDocument = objPdf.OpenDocument(FileBytes2)
        Dim objDoc3 As PdfDocument = objPdf.OpenDocument(FileBytes3)
        Dim objDoc4 As PdfDocument = objPdf.OpenDocument(FileBytes4)
 
        objMasterDoc.AppendDocument(objDoc1)
        objMasterDoc.AppendDocument(objDoc2)
        objMasterDoc.AppendDocument(objDoc3)
        objMasterDoc.AppendDocument(objDoc4)
 
        Dim strPath As String = Server.MapPath("datafiles") + "\\" + "MH_CustomPDF" + ".pdf"
        Dim strFileName As String = objMasterDoc.Save(strPath, False)
 
        txtResult.Text = "Success. Your PDF file <font color=gray>" + strFileName + "</font> can be downloaded <A TARGET=""_new"" HREF=""datafiles/" + strFileName + """><B>here</B></A>." 
    
    Catch es As Exception
    
	    txtResult.Text = es.Message
	    Exit Sub
    End Try
End Sub
</script>
</head>
<body>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
  <tr>
    <td>
<form runat="server" enctype="multipart/form-data" method="POST"><p>
  <input type="file" id="MyFile1" runat="server" /><br />
  <input type="file" id="MyFile2" runat="server" /><br />
  <input type="file" id="MyFile3" runat="server" /><br />
  <input type="file" id="MyFile4" runat="server" /><br />
  <input type="submit" name="button" id="button" value="Create Merged PDF" />
  <br />

Open in new window

smdevivoydocsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MaxOvrdrv2Commented:
have you tried this:

<form runat="server" enctype="multipart/form-data" method="POST" action="thepageyouwanttosubmitto">

and then in the page you want to submit to, copy paste your code, and replace any reference to the file coming from the form (MyFile1) to request.form (Request.Form("MyFile1")...

that's if you want it on a seperate page... to have it all on the same page, simple, put in your checkboxes, handle the postbacks via a button, and then loop through the list of checkboxes with the selected files, and stitch them together as you are doing now, by creating a temporary file, which will, one by one as you loop, have each file appended/stitched to the end...

Hope this helps.
0
smdevivoydocsAuthor Commented:
Okay - I see what you're saying but a few questions pop up as a result of my trials with this.  And, by the way, thanks for your reply.

To clarify your suggestion: From Page 1, I'm going to "Post" the files forward to Page 2, populating the empty form fields with the file names and then processing (stitching) my PDF's on Page2.  I understand the concept but my input type (<input type="file" id="MyFile1" runat="server" />) is set to "file" - should I change this to "text" to accept posted data coming from Page 1?

Well, I tried it - and when I do this I get an error saying "BC30456: 'PostedFile' is not a member of 'System.Web.UI.HtmlControls.HtmlInputText'." and references Line 15 of my original attached code above.  If I leave it as "file" it tells me this is not a "settable" version of input.

The class that consistently is throwing the error seems to be the "HttpPostedFile" class and "Posted File" property of the "FileUpload" class in lines 15 thru 18.  This class is only looking to work with files that have been uploaded by a client.  It seems that as long as that is there... I'm doomed since anything I do that does not involve an uploaded file seems to fail.

I have fixed the original link which was broken: http://www.mulehide.com/downloads/data_sheets.aspx
If you could please take another look I would greatly appreciate your help.

For now, I think I'll stick with a two page setup posting the files to the page that does the stitching.

Thanks,

Steve
0
MaxOvrdrv2Commented:
Hi,

no no, you don't need to re-create the fileform in order to get the information on the second page... you can simply, very simply, just reference Request.Form("MyFile1") from the second page and get the file from there... a multipart form can post the data to a second page without problems. Of course you have to change the behaviour (not postback will be change to is postback... etc) to accomodate the 2 pages.

this would be page 2... or something similar...
Sub Page_Load(Source As Object, E As EventArgs)
    txtResult.Text = ""
 
	If IsPostBack Then Exit Sub
 
	Dim objFile1 As HttpPostedFile = Request.Form("MyFile1")
	Dim objFile2 As HttpPostedFile = Request.Form("MyFile2")
	Dim objFile3 As HttpPostedFile = Request.Form("MyFile3")
	Dim objFile4 As HttpPostedFile = Request.Form("MyFile4")
    
    Dim objPdf As PdfManager = New PdfManager()
    
    Dim FileBytes1 As Byte() = New Byte(objFile1.InputStream.Length){}
    objFile1.InputStream.Read( FileBytes1, 0, FileBytes1.Length )
 
    Dim FileBytes2 As Byte() = New Byte(objFile2.InputStream.Length){}
    objFile2.InputStream.Read(FileBytes2, 0, FileBytes2.Length)
 
    Dim FileBytes3 As Byte() = New Byte(objFile3.InputStream.Length){}
    objFile3.InputStream.Read(FileBytes3, 0, FileBytes3.Length)
 
    Dim FileBytes4 As Byte() = New Byte(objFile4.InputStream.Length){}
    objFile4.InputStream.Read(FileBytes4, 0, FileBytes4.Length)
    
    Try
        Dim objMasterDoc As PdfDocument = objPdf.CreateDocument()
 
        Dim objDoc1 As PdfDocument = objPdf.OpenDocument(FileBytes1)
        Dim objDoc2 As PdfDocument = objPdf.OpenDocument(FileBytes2)
        Dim objDoc3 As PdfDocument = objPdf.OpenDocument(FileBytes3)
        Dim objDoc4 As PdfDocument = objPdf.OpenDocument(FileBytes4)
 
        objMasterDoc.AppendDocument(objDoc1)
        objMasterDoc.AppendDocument(objDoc2)
        objMasterDoc.AppendDocument(objDoc3)
        objMasterDoc.AppendDocument(objDoc4)
 
        Dim strPath As String = Server.MapPath("datafiles") + "\\" + "MH_CustomPDF" + ".pdf"
        Dim strFileName As String = objMasterDoc.Save(strPath, False)
 
        txtResult.Text = "Success. Your PDF file <font color=gray>" + strFileName + "</font> can be downloaded <A TARGET=""_new"" HREF=""datafiles/" + strFileName + """><B>here</B></A>." 
    
    Catch es As Exception
    
	    txtResult.Text = es.Message
	    Exit Sub
    End Try
End Sub
</script>

Open in new window

0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

smdevivoydocsAuthor Commented:
This looks great and makes sense.  I've built it up and put it into action however, it throws the following compilation error at line 15:

Compiler Error Message: BC30311: Value of type 'String' cannot be converted to 'System.Web.HttpPostedFile'.

Source Error:

Line 13:       If IsPostBack Then Exit Sub
Line 14:
Line 15:     Dim objFile1 As HttpPostedFile = Request.Form("MyFile1")
Line 16:     Dim objFile2 As HttpPostedFile = Request.Form("MyFile2")
Line 17:     Dim objFile3 As HttpPostedFile = Request.Form("MyFile3")

Any thoughts???
So sorry... I'm used to working with Classic ASP. Just starting in on .NET and having some growing pains.  I appreciate your help.  Steve
0
MaxOvrdrv2Commented:
Right... hmmm... i don't know why it's not working, i'm researching. technically, it should be super simple, but maybe it's not doing the postback properly...

but try this instead:
Line 15:     Dim objFile1 As HttpPostedFile = Request.Form("MyFile1").PostedFile
Line 16:     Dim objFile2 As HttpPostedFile = Request.Form("MyFile2").PostedFile
Line 17:     Dim objFile3 As HttpPostedFile = Request.Form("MyFile3").PostedFile

and let me know if it works or not.
0
smdevivoydocsAuthor Commented:
Now I get the following.  Damn it's close - I wish I knew more about the classes and members.

Compiler Error Message: BC30456: 'PostedFile' is not a member of 'String'.

Source Error:

Line 13:       If IsPostBack Then Exit Sub
Line 14:
Line 15:     Dim objFile1 As HttpPostedFile = Request.Form("MyFile1").PostedFile
Line 16:     Dim objFile2 As HttpPostedFile = Request.Form("MyFile2").PostedFile
Line 17:     Dim objFile3 As HttpPostedFile = Request.Form("MyFile3").PostedFile

Thanks again!
0
MaxOvrdrv2Commented:
ok, try accessing the form itself, e.g.:

Request.Form.MyFile1.PostedFile

it's not really as close as it seems... i thought this would be fairly simple but apparently they didn't allocate for that in .Net... i'm trying to cheat by using both Classic ASP and .Net together... which usually works but this time it doesn't seem to be working.

Worse, case, you'll have to do it all in one page, which would work guaranteed.

Is there a specific reason why you didn't want to do it all in one page? And do you have Visual Studio or are you coding everything by hand?
0
smdevivoydocsAuthor Commented:
I tried accessing the form itself and got the following:
Compiler Error Message: BC30456: 'MyFile1' is not a member of 'System.Collections.Specialized.NameValueCollection'.

All on one page is ultimately where I'd like to be.  The 2-page approach was just a way to split things up (more for my limited experience) to see how everything flowed.  But if that creates any type of functional problem - beggars can't be choosers - 1 page it is.  In fact, just go that route.

I'm coding everything by hand.  I started with a sample script from Persits and, for the most part, it's in its virgin state.  Here is a comment sent to me from Peter Persits himself when I originally put this issue to him: "You can use FileSystemObject or AspUpload to create a list of all files in a directory to let the user select those he needs. Some heavy-duty coding would be required to implement this interface, I imagine."

I've reattached the code as it stands right now for reference.

Again, thanks for the help.  Not only will you get the points for effort alone, I'd even buy ya a beer... but you'd have to be in the Chicago area for that.
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="Persits.PDF" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mule-Hide Data Sheets</title>
<script runat="server" language="vb">
Sub Page_Load(Source As Object, E As EventArgs)
    txtResult.Text = ""
 
	If IsPostBack Then Exit Sub
 
    Dim objFile1 As HttpPostedFile = Request.Form.MyFile1.PostedFile
    Dim objFile2 As HttpPostedFile = Request.Form.MyFile2.PostedFile
    Dim objFile3 As HttpPostedFile = Request.Form.MyFile3.PostedFile
    Dim objFile4 As HttpPostedFile = Request.Form.MyFile4.PostedFile
 
    
    Dim objPdf As PdfManager = New PdfManager()
    
    Dim FileBytes1 As Byte() = New Byte(objFile1.InputStream.Length){}
    objFile1.InputStream.Read( FileBytes1, 0, FileBytes1.Length )
 
    Dim FileBytes2 As Byte() = New Byte(objFile2.InputStream.Length){}
    objFile2.InputStream.Read(FileBytes2, 0, FileBytes2.Length)
 
    Dim FileBytes3 As Byte() = New Byte(objFile3.InputStream.Length){}
    objFile3.InputStream.Read(FileBytes3, 0, FileBytes3.Length)
 
    Dim FileBytes4 As Byte() = New Byte(objFile4.InputStream.Length){}
    objFile4.InputStream.Read(FileBytes4, 0, FileBytes4.Length)
    
    Try
        Dim objMasterDoc As PdfDocument = objPdf.CreateDocument()
 
        Dim objDoc1 As PdfDocument = objPdf.OpenDocument(FileBytes1)
        Dim objDoc2 As PdfDocument = objPdf.OpenDocument(FileBytes2)
        Dim objDoc3 As PdfDocument = objPdf.OpenDocument(FileBytes3)
        Dim objDoc4 As PdfDocument = objPdf.OpenDocument(FileBytes4)
 
        objMasterDoc.AppendDocument(objDoc1)
        objMasterDoc.AppendDocument(objDoc2)
        objMasterDoc.AppendDocument(objDoc3)
        objMasterDoc.AppendDocument(objDoc4)
 
        Dim strPath As String = Server.MapPath("datafiles") + "\\" + "MH_CustomPDF" + ".pdf"
        Dim strFileName As String = objMasterDoc.Save(strPath, False)
 
        txtResult.Text = "Success. Your PDF file <font color=gray>" + strFileName + "</font> can be downloaded <A TARGET=""_new"" HREF=""datafiles/" + strFileName + """><B>here</B></A>." 
    
    Catch es As Exception
    
	    txtResult.Text = es.Message
	    Exit Sub
    End Try
End Sub
</script>
</head>
<body>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
  <tr>
    <td>
<form runat="server" enctype="multipart/form-data" method="POST"><p>
  <input type="file" id="MyFile1" runat="server" /><br />
  <input type="file" id="MyFile2" runat="server" /><br />
  <input type="file" id="MyFile3" runat="server" /><br />
  <input type="file" id="MyFile4" runat="server" />
  <br />
  <br />
  <input type="submit" name="button" id="button" value="Create Merged PDF" />
  <br />
  <asp:Label id="txtResult" Font-Bold= "true" runat="server"/></p>
  </form></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>

Open in new window

0
MaxOvrdrv2Commented:
I would suggest getting Visual Studio... you can get a free copy on Microsoft's web site, and it's well worth it since it creates all of the proper folder structures and file structures for you. You are currently coding your code-behind inside the HTML page. This is not the intended use of the .Net framework. It works, but it is not recommended.

GO get Visual Studio, and make sure you get the right version for the framework that you are using...

Framework 1.1. = Visual Studio 2003
Framework 2.0 = Visual Studio 2005
Framework 3.5 = Visual Studio 2008

Once you have Visual Studio going , and you have created your new "Web Site", here is a working example of a one page solution:


in your HTML PAGE:
 
 
<asp:FileUpload ID="MyFile1" runat="Server" /><br />
<asp:FileUpload ID="MyFile2" runat="Server" /><br />
<asp:FileUpload ID="MyFile3" runat="Server" /><br />
<asp:FileUpload ID="MyFile4" runat="Server" /><br />
<asp:Button ID="btn1" runat="Server" Text="Upload Files" />
 
in your CODE-BEHIND PAGE (.aspx.vb):
 
Protected Sub btn1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn1.Click
 
    Dim objFile1 As HttpPostedFile = Me.MyFile1.PostedFile
    Dim objFile2 As HttpPostedFile = Me.MyFile2.PostedFile
    Dim objFile3 As HttpPostedFile = Me.MyFile3.PostedFile
    Dim objFile4 As HttpPostedFile = Me.MyFile4.PostedFile
     
    Dim objPdf As PdfManager = New PdfManager()
    
    Dim FileBytes1 As Byte() = New Byte(objFile1.InputStream.Length){}
    objFile1.InputStream.Read( FileBytes1, 0, FileBytes1.Length )
 
    Dim FileBytes2 As Byte() = New Byte(objFile2.InputStream.Length){}
    objFile2.InputStream.Read(FileBytes2, 0, FileBytes2.Length)
 
    Dim FileBytes3 As Byte() = New Byte(objFile3.InputStream.Length){}
    objFile3.InputStream.Read(FileBytes3, 0, FileBytes3.Length)
 
    Dim FileBytes4 As Byte() = New Byte(objFile4.InputStream.Length){}
    objFile4.InputStream.Read(FileBytes4, 0, FileBytes4.Length)
    
    Try
        Dim objMasterDoc As PdfDocument = objPdf.CreateDocument()
 
        Dim objDoc1 As PdfDocument = objPdf.OpenDocument(FileBytes1)
        Dim objDoc2 As PdfDocument = objPdf.OpenDocument(FileBytes2)
        Dim objDoc3 As PdfDocument = objPdf.OpenDocument(FileBytes3)
        Dim objDoc4 As PdfDocument = objPdf.OpenDocument(FileBytes4)
 
        objMasterDoc.AppendDocument(objDoc1)
        objMasterDoc.AppendDocument(objDoc2)
        objMasterDoc.AppendDocument(objDoc3)
        objMasterDoc.AppendDocument(objDoc4)
 
        Dim strPath As String = Server.MapPath("datafiles") + "\\" + "MH_CustomPDF" + ".pdf"
        Dim strFileName As String = objMasterDoc.Save(strPath, False)
 
        txtResult.Text = "Success. Your PDF file <font color=gray>" + strFileName + "</font> can be downloaded <A TARGET=""_new"" HREF=""datafiles/" + strFileName + """><B>here</B></A>." 
    
    Catch es As Exception
    
	    txtResult.Text = es.Message
	    Exit Sub
    End Try
End Sub

Open in new window

0
smdevivoydocsAuthor Commented:
Well, I may have to step back from this for a while to clear my head.  I tried the above, and it works, but it still wants to function SOLELY with files uploaded by/from the client.  I can't seem to enter, post or set an initial value into any of the four fields to allow the entry of a server side PDF file path.

The page using your example above is at: http://www.mulehide.com/downloads/data_sheets_052809.aspx

It seems the HttpPostedFile class is restricting the function to client file uploads only.  I don't know if the HtmlInputFile class is a better alternative or HtmlInputText for that matter.  I tried them but then it didn't like the.InputStream... saying it is not a member of that class.

If it was possible to set the initial value of <asp:FileUpload /> and have the script work on those values, I'd at least have a pseudo-working version.

If you have bigger and better things to move on to that's fine.  But if you have any other ideas... I'm all ears/eyes.

Thanks
0
MaxOvrdrv2Commented:
ok wait, what are you trying to do exactly? upload files from the server to the clients, or upload files from the clients to the server?

why would you want to set an initial value? how could you know where the client has their PDFs stored?

if you simply want the clients to select a bunch of PDFs LISTED from the SERVER, and then go through your thing where it appends each PDF one by one to a temporary file, and then spit that file out to the browser so that your users can DOWNLOAD the final stitched file, then it's something completely different than your usual question. But i can help with that too.
0
smdevivoydocsAuthor Commented:
Yep, that's exactly what I want to do.  Actually, my initial question at the top of this thread says it all (in probably way too many words).  But, in a nutshell, here's what I need:  I have hundreds of PDF's sitting on my website.  I want to put them in a list (subsets only - not the entire library) and have the visitor/client select, using check boxes, only the PDF files they need.

Then, upon button click, stitch those selected PDF's into a single PDF using the Persits component (or someone elses).

Client is then presented with a link for a single PDF to view or save as needed.

I apologize for the wording of my initial request.  I should have gotten right to the point.  Thanks for putting up with me and walking me through to a solution.
0
smdevivoydocsAuthor Commented:
I don't know if you've had a chance to work on a solution, based on your last entry, but I have been tinkering with this.

Please take a look at this link... http://www.mulehide.com/downloads/type.aspx - select the 2 check boxes and hit Continue.  You'll see I am posting paths (to page: "type_read.aspx") for 2 PDF files.

This was prompted by a note I received from Peter Persits, developer of the component:

"Assuming you have your file path in the variable strPath, the code would bePdfDocument objDoc = objPdf.OpenDocument(strPath);You don't need to use PostedFile at all."

Not really knowing what I'm doing and, with some time on my hands, I thought I'd play around with the VB on "page_read.aspx"...  I've posted my code.  Am I being naive or is it fairly straight forward, now that file paths are present, to stitch those paths (PDF's) together?

Once again, all help is appreciated!
<input id="gwProxy" type="hidden"><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden">
<%@ Page Language="VB" Debug="true" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI.HtmlControls" %>
<%@ Import Namespace="Persits.PDF" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Here Are The PDF Files</title>
<script runat="server" language="vb">
Sub Page_Load(Source As Object, E As EventArgs)
    txtResult.Text = ""
 
	If Not IsPostBack Then Exit Sub
 
	Dim strPath1, MyFile1 as String
	Dim strPath2, MyFile2 as String
 
    Dim objPdf As PdfManager = New PdfManager()
    
    Try
        Dim objMasterDoc As PdfDocument = objPdf.CreateDocument()
 
        Dim objDoc1 As PdfDocument = objPdf.OpenDocument(strPath1)
        Dim objDoc2 As PdfDocument = objPdf.OpenDocument(strPath2)
 
        objMasterDoc.AppendDocument(objDoc1)
        objMasterDoc.AppendDocument(objDoc2)
 
        Dim strPath As String = Server.MapPath("datafiles") + "\\" + "MH_CustomPDF" + ".pdf"
        Dim strFileName As String = objMasterDoc.Save(strPath, False)
 
        txtResult.Text = "Success. Your PDF file " + strFileName + " can be downloaded <a TARGET=""_new"" href=""datafiles/" + strFileName + """>here</a>." 
    
    Catch es As Exception
    
	    txtResult.Text = es.Message
	    Exit Sub
    End Try
End Sub
</script>
</head>
<body>
<form runat="server" >
  <p>
    <input name="MyFile1" type="text" id="MyFile1" value="<%= Request.Form("MyFile1") %>" size="50" /><br />
    <input name="MyFile2" type="text" id="MyFile2" value="<%= Request.Form("MyFile2") %>" size="50" /><br /><br />
    <asp:Button ID="btn1" runat="server" Text="Create Merged PDF" />    
    <br />
      <asp:Label id="txtResult" runat="server"/><br />
  </p>
  <p><a href="type.aspx">Back to Type Page</a></p>
</form>
</body>
</html>

Open in new window

0
MaxOvrdrv2Commented:
Yes, that is correct, you don't even need a posted file or anything like that... i thought you were trying to do the opposite (get files from client PC over to your server)....

for the stitching, i don't know the persists object much, but it's fairly simple:

simply list all the files using the DirectoryInfo object, put the names in a checkbox list, then put a button, with the button onClick event, get the file names selected in the checkbox list by looping through the collection, then once you have them, stitch them together using the persists object, but here's the trick:

on the first run through the loop:
get the first 2 files, and stitch them together into a file named appropritately (UserNameTmp.pdf)

on all other iterations through the loop:
get the next files, and the UserNameTmp.pdf file, and stitch those 2 together, until you're done.

Using the UserNameTmp.pdf (UserName being the actual username) will ensure that you have a unique filename. You can then, once it's all stitched, hide the checkbox list, and display a label with a <a href> containing the filename UserNameTmp.pdf which should now be stitched.

Makes sense? this is all pseudo-coded of course...

Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
smdevivoydocsAuthor Commented:
Thanks for all your time on this.  Your solution makes perfect sense!  I appreciate the help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.