Not sure if I am in a right section, but I am new to using Aspose for my file conversions. At the moment I am having trouble getting the filename and extension from an html based upload. We previously used a different third party software for uploads, but are getting rid of it after moving to Aspose. What process do you recommend for uploading files that can be used in conjunction with Aspose.Pdf and/or Aspose.Words to convert the uploaded document to PDF?
Thanks for your inquiry. I think, you can simply upload files via ASP.NET and then pass in the stream to Aspose.Words document object model to be able to convert any Word document to PDF format. Please try using the following code snippet:
// Load the Word document into a stream. MemoryStream stream = new MemoryStream(dataBytes); LoadOptions lo = new LoadOptions(); lo.LoadFormat = LoadFormat.Docx; Document doc = new Document(stream, lo); // Save the document to disk. // The extension of the filename can be changed to save the document into other formats. e.g PDF, DOCX, ODT, RTF. doc.Save(MyDir + "Out.pdf");
I hope, this will help.
Should have also noted that I am trying to do this is Classic ASP.
Thank you for the response. I should’ve re-loaded the page before writing my previous post. The problem lies in the fact that I am trying to accomplish this through classic ASP. I am uploading the file through HTML, and trying to obtain the filename / path from that form. How would I go about converting your suggestion to classic ASP?
Thanks for your interest in our products.
I am a representative from Aspose.Pdf team. Please note that Aspose.Pdf for .NET provides the capability to create/edit/manipulate PDF documents. It also provides the capability to use it under unmanaged code with the help of COM Interoperatibility. Now concerning to your requirement, you may try uploading the files using some HTML or other control and once the file is saved on server, you can use that document for further processing using Aspose.Pdf for .NET. Please visit the following link for information on
Aspose.Pdf for .NET is a document manipulation control and I am afraid it does not directly provide the capability to upload documents over server. We are sorry for your inconvenience.