| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| file_storage [2025/03/29 15:48] – added Redacted column to wtkFiles table wtkadmin | file_storage [2025/03/30 17:56] (current) – [Private File Cleanup] wtkadmin |
|---|
| |
| <code php> | <code php> |
| function wtkFormFile($fncTable, $fncColPath, $fncFilePath, $fncFileName, $fncLabel = '', $fncColSize = 'm6 s12', $fncRefresh = '', $fncShowOneClickUpload = 'N', $fncAccept = 'accept="image/*"', $fncThumbnail = 'Y') | /** |
| </code> | * @param string $fncTable name of data table |
| | * @param string $fncColPath name of data column to hold path to image/file |
| | * @param string $fncFilePath actual path on webserver |
| | * @param string $fncFileName name of data column to hold new name of file uploaded |
| | * @param string $fncLabel optionally passed to show as label; if not then uses $fncColName |
| | * @param string $fncColSize MaterializeCSS column sizing - defaults to 'm6 s12' |
| | * @param string $fncRefresh defaults to '' blank; set to image ID you want refreshed upon saving (by JS) |
| | * @param string $fncShowOneClickUpload defaults to 'N' but if set to 'Y' then adds button to upload using AJAX without needing a 'Save' button |
| | * @param string $fncAccept defaults to 'accept="image/*"'; you can change this to other document filters like accept=".pdf" |
| | * @param string $fncThumbnail defaults to 'Y'; if set to 'Y' then adds an <img id="imgPreview" ...> which will show a preview of images |
| | * @param number $fncFormId usually leave this with default of '1' but if you have more than one file upload on a page, each must have this parameter different |
| | * @param string $fncAllowDelete defaults to 'Y' which shows a Delete button to delete file on server |
| | * @return html returns surrounding HTML for input type="file" |
| | */ |
| |
| * $fncTable name of data table | function wtkFormFile($fncTable, $fncColPath, $fncFilePath, $fncFileName, |
| * $fncColPath name of data column to hold path to image/file | $fncLabel = '', $fncColSize = 'm6 s12', $fncRefresh = '', |
| * $fncFilePath actual path on webserver | $fncShowOneClickUpload = 'N', $fncAccept = 'accept="image/*"', |
| * $fncFileName name of data column to hold new name of file uploaded | $fncThumbnail = 'Y', $fncFormId = '1', $fncAllowDelete = 'Y') { |
| * $fncLabel optionally passed to show as label; if not then uses $fncColName | // ... |
| * $fncColSize MaterializeCSS column sizing - defaults to 'm6 s12' | } |
| * $fncRefresh defaults to blank; set to image ID you want refreshed upon saving (by JS) | </code> |
| * $fncShowOneClickUpload defaults to 'N' but if set to 'Y' then adds button to upload using AJAX without needing a 'Save' button | |
| * $fncAccept defaults to 'accept="image/*"'; you can change this to other document filters like accept=".pdf" | |
| * $fncThumbnail defaults to 'N'; if set to 'Y' then adds an <img id="imgPreview" ...> which will show a preview of images but only if it is stored locally | |
| |
| ===== Public Files ===== | ===== Public Files ===== |
| * fast uploads due to CDN | * fast uploads due to CDN |
| |
| Message Alec for more details. | [[https://wizardstoolkit.com/contact.php|Contact us]] for more details. |