Can DFPro process PDF files?
Question, can DFPro handle PDF files for upload? I am trying to configure PS2 which uses DFPro for image uploads and am curious to know if/how to get DFPro to upload PDF files the same as it would an image file?
Question, can DFPro handle PDF files for upload? I am trying to configure PS2 which uses DFPro for image uploads and am curious to know if/how to get DFPro to upload PDF files the same as it would an image file?
You can use DFP to upload PDF files, you would just not select the web images only checkbox. This will allow any type of file to be uploaded.
If you want to restrict this to pdf files only, you would have to apply validation on the file field to prevent other files from being uploaded. If you have Validation Toolkit or CSS Form Builder, you can apply this validation using those tools.
Jimmy Wu,
"You can use DFP to upload PDF files, you would just not select the web images only checkbox"
Thank you for your reply to my question, I guess my next question would be to ask why the version of DFP that I have, the version I have is included with PowerStore 2, does not have a "web images only checkbox"?
It seams to be the internal validator used within the Validation ToolKit & DFP Helper.php that thinks the PDF is an image file, it always returns an error from what I think is the attempt to manipulate the file on rename and upload, not sure but really need to get around this.
Which version of Digital File Pro are you using?
I'm sorry, I didn't realize you were using this with PowerStore v2. You will have to go to the server behaviors panel and double click on the WA Upload Files server behavior. In step 1, under Upload Settings, you will have to uncheck the Web images only checkbox.
If you are using Digital File Pro v1, you will have to change the code manually. Find the code that looks like this:
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "ProductImage", "2", "[NewFileName]_[Increment]", "true", $WA_UploadResult1_Params);
}
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult2", "ProductThumb", "2", "[NewFileName]_[Increment]", "true", $WA_UploadResult2_Params);
}
?>
Change the "true" to "false", which is the parameter that specifies whether it should be web images only or not.
The validation on the field will continue to only allow images, so you would have to modify the validation code to include pdf files. The input field should look like this:
<input name="ProductThumb" type="file" id="ProductThumb" onchange="WAValidateFE(document.forms[0].ProductThumb,document.forms[0].ProductThumb.value,'- Invalid file extension','.gif, .jpg, .jpeg, .png',document.forms[0].ProductThumb,0,true);WAValidateHD(document.forms[0].ProductThumb,'ProductThumbValidation',false);if (document.getElementById('ProductThumbServerValidation')) document.getElementById('ProductThumbServerValidation').style.display='none'" />
You will have to find the list of allowed file extensions:
'.gif, .jpg, .jpeg, .png'
And change the list to what you want allowed. You will have to do this for both the input boxes.
As far as i am considered, DFPro can process PDF files. Processing pdf is easy as that of image as long as you embed a professional pdf processor. Above detaield code and tips are really helpful, do as it demonstrated.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.