Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Björn Töpper on Jan 23, 2008 23:45
open dhtmlx forum
dhtmlx Vault

1. How can i prevent some filetypes.
For example I will only allow .png Files to upload ?

2. How can I set the max Upload size. I can not change it in the php.ini.
Is there a way to change it by the script?

sorry for my english. Im german.
Answer posted by Support on Jan 24, 2008 02:40
>>1. How can i prevent some filetypes.
>>For example I will only allow .png Files to upload ?

The dialog which used for selecting files not configurable from js code, so it will be possible to select any file, but you can modify existing code to add necessary check

dhtmlXVaultObject.prototype.addFile = function()
{
    var currentId = this.createId();

    var file = this.currentFile;
    var fileName = this.getFileName(file.value);
    if (fileName.indexOf(".png")==-1) return;

>>2. How can I set the max Upload size. I can not change it in the php.ini.
>>Is there a way to change it by the script?

The size of file can be checked only on server, it can't be controled on client side.