[[!FileUpload?
&path=`[[+filePath]]`
&filefields=`1`
&targetfile=`dave.pdf`
&maxsize=`2000000`
&extensions=`pdf`
&uploadgroups=`uploadGroup`]]<?php
$fundSelect= htmlspecialchars($_POST['fundSelect']);
$fileTypeSelect= htmlspecialchars($_POST['fileTypeSelect']);
$thePath = '../PDF/'.$fundSelect.'/'.$fileTypeSelect.'/';
$realPath = realpath($thePath);
$filePath = $realPath.'/';
$modx->setPlaceHolder('fileType',$fileTypeSelect);
$modx->setPlaceHolder('filePath',$filePath);
$modx->setPlaceHolder('realPath',$realPath);
return '';[[!FileUpload?
&path=`[[!+filePath]]`
&filefields=`1`
&targetfile=`dave.pdf`
&maxsize=`2000000`
&extensions=`pdf`
&uploadgroups=`uploadGroup`
]]Did you try to call the placeholder uncached?
[[!FileUpload? &path=`[[!+filePath]]` &filefields=`1` &targetfile=`dave.pdf` &maxsize=`2000000` &extensions=`pdf` &uploadgroups=`uploadGroup` ]]
Is your own snippet tag above the FileUpload tag? If not, move it there.
<h2>[[*pagetitle:ucase]]</h2>
[[!fileUploadSnippet]]
<p>Upload a [[+fileType]] file to [[+fundName]]</p>
<div class="uploadPart">
[[!FileUpload?
&path=`[[!+realPath]]`
&filefields=`1`
&targetfile=`dave.pdf`
&maxsize=`2000000`
&extensions=`pdf`
&uploadgroups=`KriyaEditor`]]
</div>Ah, you didn't mention that the FileUpload tag was in a chunk. Try moving it up to the page content or the template.Tried it.
[[!fileUploadSnippet]]
<p>Upload a [[+fileType]] file to [[+fundName]]</p>
<div class="uploadPart">
[[!FileUpload?
&path=`[[!+realPath]]`
&filefields=`1`
&targetfile=`dave.pdf`
&maxsize=`2000000`
&extensions=`pdf`
&uploadgroups=`KriyaEditor`]]
</div><h2>[[*pagetitle:ucase]]</h2>
[[*content]]
<script type="text/javascript" src="xresource/scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
function deleteImage(file_name) {
var r = confirm("Are you sure you want to delete file_name?")
if(r == true) {
$.ajax({
url: 'deleate.php',
data: {'file' : "[[+realPath]]/" + file_name },
success: function (response) {
// do something
},
error: function () {
// do something
}
});
}
}
</script>
<div class="existingFiles">
<p>RealPath: [[+realPath]]<br>
FILEPATH:[[+filePath]]
</p>
[[!FileLister?
&path=`../PDF/[[+filePath]]`
&fileTpl=`CurrentFilesListTPL`
&sortBy=`filename`
&sortDir=`DESC`
]]
</div><!DOCTYPE html> <html lang="en"> <head> [[$metaStandard]] </head> <body> <div class="wrapper"> <div class="header"> [[$LogoBread]] [[$welcomeLogin]] </div> <div class="content"> <div class="selectlist">[[$content_[[*contentTypeTV]]]]</div> </div> [[showFooter?]] </div> [<!-- -->[$Analytics? &trackUser=`[[$trackUserVar?]]`]] </body> </html>