Congratulations on purchasing the new Upload/Webcam Avatar module!1. Easy to launch It's very simple to launch it, just login 123FlashChat Admin Panel-> Module Settings-> Upload/Webcam Avatar Module and check "Enable Custom Avatar". (Be sure you have purchased ultimate package or the new module separately, and the license dat file you've installed already has upload/webcam avatar module inside.) And subsequently, Admin Panel-> User Management-> User Group Settings, check "Enable Custom Avatar" for any specific user group (admin/ registered users /guest) if necessary.
2. HTTP server VS. PHP mode? Since the new module is similar to the other two modules: Image Transfer and File Transfer, it will involve a server to store the pictures.
HTTP server is more convenient 123FlashChat has a HTTP server embedded, so no extra configuration is needed, unless snappier performance is expected to deal with multiple concurrent upload requests or to achieve faster speed. PHP server is recommended Since it might influence the performance of the chat server itself more or less if using the HTTP server to deal with the custom avatar stuff, the PHP mode is preferred. With your own web server undertaking this part of work, the chat server can run more smoothly. 3. Advanced settings for HTTP server mode (1) Change upload filesize limit open <123flashchat server install directory>/server/etc/fcserver.xml find <http-server port="35555" maxUpLoadSize="5120" enable="On" documentRoot="..\client" ip="*"> <file-allow-access></file-allow-access> </http-server>
Modify the maxUpLoad Size, 5120 means 5120KB= 5MB, (this is a global setting which also constrains the image transfer module and the file transfer module, so it's relatively big).
Note, there is a similar setting in Admin Panel -> Module Settings -> Upload/Webcam Avatar Module, and the max filesize there will be subject to the value in fcserver.xml. (2) Optimize performance You will need to do the following configuration.
(i) Open <123flashchat server install directory>/server/etc/fcserver.xml Find <http-listen-workers>5</http-listen-workers> Change it to a proper value between 20 and 50. Find <http-message-handle-workers>10</http-message-handle-workers> Change it to a proper value between 20 and 50. (ii) If you're on a Linux/Unix server, adjust the memory allocation for the server as follows: cd <123flashchat installation directory>/server vi fcserver.vmoptions At the last line of this file, there is a symbol "#", remove it and then adjust the value followed by the Xmx, then save it. ./fcserver stop ./fcserver start Note (i) Please ensure there's a file called "crossdomain.xml" under "documentRoot" which is defined in fcserver.xml. (ii) The uploaded files are saved in this directory: <123flashchat http server documentRoot directory>/avatar/default/upload, And it should be readable and writeable. (iii) In admin panel -> Module Settings -> Upload/Webcam Avatar Module, the Upload URL and Download URL must be left blank if 123FlashChat HTTP server method is used. (iv) Please restart the chat server to make the changes in "fcserver.xml" effective. 4. PHP mode The PHP mode is recommended if a chat room with busy traffic is involved, to achieve faster speed and better performance. (1) Configurations Open "config.php" in the Upload/Webcam Avatar Module package and configure it: - $MAX_ALLOW_FILE_SIZE: the max upload file size (unit: bytes)
- $FILE_PATH: the upload file path. It's not supposed to be under the Apache or IIS document root path, because the uploaded files should never be accessed from a HTTP URL directly for security sake. Also, ensure that the $FILE_PATH is readable and writeable by Apache or your web server.
- $ALLOW_FILE_EXTS: the supported file extension types, e.g., $ALLOW_FILE_EXTS = ".jpeg,.jpg". Leave it blank to tolerate all kinds of file extension types. - $ALLOW_FILE_MIMES: the supported file MIMES for security reason, e.g., $ALLOW_FILE_EXTS = "image/jpeg,image/jpg". Leave it blank to tolerate all kinds of file MIMES. However it's not recommended to stop virus from speading. (2) Copy PHP files and crossdomain.xml Copy all the PHP files in the "uploadavatar" package to a folder under web server directory, because they will be needed to be accessed from the HTTP address.
Copy the "crossdomain.xml" in the Upload/Webcam Avatar Module package to the document root folder of the upload avatar HTTP address. (3) Configure Admin Panel Login 123FlashChat Admin Panel-> Module Settings-> Upload/Webcam Avatar Module Check "Enable Custom Avatar". i) Find: Upload URL, configure it to the HTTP URL which directs to uploadFile.php, ii) Find: Download URL, configure it to the HTTP URL which directs to $FILE_PATH in config.php. Edit Max filesize, the unit is KB as well. Note, the max filesize in Admin Panel will be subject to the value in fcserver.xml. (4) Edit PHP.ini Find option 'file_uploads', change the value to 'On'. Fine option 'upload_max_filesize', change the value to the same with 'MAX_ALLOW_FILE_SIZE' in config.php. Then restart Apache or your web server. |