Upload PDF and Doc files with Advanced HTML Editor 2
Is it possible to upload a PDF or Word document into the Advance HTML Editor 2?
Answer:
With a small modification to the code you can upload PDF and Doc files using Advanced HTML Editor 2.
Please follow these steps:
1. Open for edit the following file: AdvHTML_Popups\upload.asp
Note: This file is if you use Pure ASP Upload.
For Pure PHP Upload you have to edit the file: upload.php
2. Add the PDF and DOC file extensions to the JavaScript function which checks the files.
To do that, change the following code:
Line:
pau_Extensions = "GIF,JPG,JPEG,BMP,PNG"
Topau_Extensions = "PDF,DOC,GIF,JPG,JPEG,BMP,PNG"
Line: onsubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,
'','','','','','width','height');return document.MM_returnValue"
onsubmit="checkFileUpload(this,'PDF,DOC,GIF,JPG,JPEG,BMP,PNG',true,
'','','','','','width','height');return document.MM_returnValue"
onchange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,
'','','','','','width','height')"
onchange="checkOneFileUpload(this,'PDF,DOC,GIF,JPG,JPEG,BMP,PNG',true,'','','','','','width','height')"
3. Save the fileNotes: This workaround will allow you to upload both PDF and Doc files but it has some side effects:
1. The files are uploaded from the Insert Image popup.
2. Once the file is uploaded it generates an img tag:
For example:
<img alt="" src="http://localhost/HTMLEdit2/Upload/Report_2007.pdf" align="bottom" border="0" hspace="0" vspace="0" />
Which should be manually deleted or changed to an <A> tag.
Comments
Be the first to write a comment
You must me logged in to write a comment.