There are two simple steps to create a custom upload button:
- Create a HTML button or image button which will be used as custom upload button.
- Use the InsertButtonID property to specify the ID of the control that will be used as the upload button.
Example:
- //Step 1: Register Uploader component to your page
- <?php require_once "phpuploader/include_phpuploader.php" ?>
- <html>
- <body>
- <form id="form1" method="POST">
- <?php
- //Step 2: Create Uploader object.
- $uploader=new PhpUploader();
- //Step 3: Set a unique name to Uploader
- $uploader->Name="myuploader";
- //Step 4: Specify ID of the control that will be used as upload button.
- $uploader->InsertButtonID="uploadbutton";
- //Step 5: Render Uploader
- $uploader->Render();
- ?>
- <img id="uploadbutton" alt="Upload File" src="sampleimages/upload.png" />
- </form>
- </body>
- </html>