PHP File Upload Toggle


/ Published in: PHP
Save to your folder(s)

Just a quick and dirty way to handle file uploads in admin tools


Copy this code and paste it in your HTML
  1. <div class="formRow">
  2. <label for="related_file">Related File:</label>
  3. <?
  4. if ($oEvent->is_populated("related_file"))
  5. {
  6. echo "<span id=\"replaceFileInfo\">Currently ".$oEvent->get("related_file").". <a href=\"#\" onclick=\"document.getElementById('docUploadBox').style.display='block';document.getElementById('replaceFileInfo').style.display='none';return false;\">Replace?</a></span>";
  7. echo "<span id=\"docUploadBox\" style=\"display: none;\">";
  8. }
  9. else
  10. {
  11. echo "<span id=\"docUploadBox\">";
  12. }
  13. ?>
  14. <input type="file" class="fileUpload" tabindex="9" name="related_file" id="related_file" />
  15. </span>
  16. </div>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.