Xajax 0.2: Tips and Tricks: File Upload in 0.2.4
Xajax 0.2: Tips and Tricks: File Upload in 0.2.4
This page describes how to implement file uploads in xajax 0.2.4. There are new ways of doing things in 0.5.0 (see Other Resources below). The information on this page is based off a thread found in the forums: http://community.xajaxproject.org/viewtopic.php?id=1709 and the original author is RainChen with some contributions from ajaxello.
Contents |
[edit] Features & Limitations:
- No progress bar, this is just a straight upload using xajax
- Pure PHP, no perl/cgi-bin required
- Works on Firefox (fixed the "Transferring info ..." problem) and MSIE
- Requires two additional files (one PHP and one Javascript file) to the base 0.2.4 xajax files
[edit] Basics
- xajaxExtend.php goes to where xajax.inc.php
- xajax_extend.js goes to where xajax.js
- demo.php goes anywhere
[edit] Files
- Download files (.zip) here: http://www.chrisgo.com/xajax/xajaxFileUpload.zip
- Contains ALL xajax files to get you going (new files are described above)
[edit] Notes
- This seems to only work for enctype="multipart/form-data" forms
- Needs to use onsubmit part of the <form> to call the javascript
[edit] Other resources
- xajax 0.5.0 version: http://www.concepts.net.nz/xajax/file_upload_example.php
- Other techniques: http://community.xajaxproject.org/viewtopic.php?id=2272