| View previous topic :: View next topic |
| Author |
Message |
golgotha
Joined: 18 Nov 2006 Posts: 3
|
Posted: Nov 18, 2006 1:37 pm Post subject: set max_file_size within form |
|
|
Hi, I just purchased xuploadpro.
I have 3 questions:
1. What I would like to do, is have the max-file-size variable dynamic based on the user using the form.
For example, in mysql table, each user has their own custom max_file_size parameter. With PHP, I would like to deliver that custom max_file_size to the upload.cgi.
Can this be done?
2. In the Xupload free version, you could specify in the form what filetypes were permitted. However, I don't see it in the pro version. How can I specify specific filetypes within the form itself? (so I can have different forms allowing different filetypes)
3. There are many unknown variables that are certain to change behaviors but are undocumented. For example, xmode, css_type and others. Is there documentations somewhere describing all of these and their behaviors?
Thanks! |
|
| Back to top |
|
 |
rob1984
Joined: 16 Nov 2006 Posts: 8
|
Posted: Nov 18, 2006 6:33 pm Post subject: |
|
|
i don't know the answers but i do have 1 question, did it work for you to change the extension of upload_Form.html to upload_form.php ?
If I do this, i get an error (file not found) |
|
| Back to top |
|
 |
PilgrimX182

Joined: 22 Mar 2006 Posts: 1107 Location: Undisclosed location
|
Posted: Nov 20, 2006 6:21 am Post subject: |
|
|
golgotha,
1) It's unsecure to have max-file-size variable in form on user side, thay can just edit it manually and upload any size they want. Right now we're using xmode hidden field to specify upload mode. Take a look into XUploadConfig.pm for these modes examples. Anyway, if you feel ok with this, I can create quick hack for you.
2) That is correct. Now using file extensions from XUploadConfig, so you don't need to specify them in 2 places, but in one config only.
3) xmode - upload mode you wanna use. Modes are specified in XUploadConfig.pm
css_name - name of CSS style, specified in XUploadConfig.pm, style
files should be in Styles folder
tmpl_name - name of HTML template, specified in XUploadConfig.pm, style
files should be in Templates folder
rob1984, should work all right if you can execute php files in that folder. |
|
| Back to top |
|
 |
golgotha
Joined: 18 Nov 2006 Posts: 3
|
Posted: Nov 20, 2006 9:33 am Post subject: |
|
|
Thanks for the answers Pilgrim.
2 and3 are answered and I understand.
On number 1, I am storing the max_file_size in a mysql table for each user. How about assigning that max_file_size as a session variable. My problem is, how do I get the XUploadconfig.pm to read a php session variable?
Thanks! |
|
| Back to top |
|
 |
PilgrimX182

Joined: 22 Mar 2006 Posts: 1107 Location: Undisclosed location
|
Posted: Nov 20, 2006 12:09 pm Post subject: |
|
|
I'm sorry to tell you this, but it's not so easy to implement now. Possible, but require time that I don't have now. The easiest way is to check for filesize and user limit in your PHP script After upload, then decide keep the file or delete.
I will think about this feature, maybe will do some magic in next version, not sured, too unsecure. |
|
| Back to top |
|
 |
chrisdpucci
Joined: 11 Oct 2006 Posts: 9
|
Posted: Nov 20, 2006 1:56 pm Post subject: |
|
|
golgotha,
Why don't you do some pre-upload php work and then set the xmode variable based on the users upload allowances? |
|
| Back to top |
|
 |
golgotha
Joined: 18 Nov 2006 Posts: 3
|
Posted: Nov 21, 2006 1:22 pm Post subject: |
|
|
ah, so I guess the easiest way to set this up is to use separate xmode's for each scenario.
That will work.
Thanks |
|
| Back to top |
|
 |
PilgrimX182

Joined: 22 Mar 2006 Posts: 1107 Location: Undisclosed location
|
Posted: Nov 22, 2006 7:03 am Post subject: |
|
|
Yea. This will work if you have only 2-5 distinct limit amounts.
Won't work if you have individual limit for every user (need number of xmodes = number of users this in case).
 |
|
| Back to top |
|
 |
Ceroscuro
Joined: 23 Nov 2006 Posts: 2
|
Posted: Nov 23, 2006 11:39 pm Post subject: |
|
|
| How would you go about setting this just from a value within the form? |
|
| Back to top |
|
 |
PilgrimX182

Joined: 22 Mar 2006 Posts: 1107 Location: Undisclosed location
|
Posted: Nov 24, 2006 6:41 am Post subject: |
|
|
Ha. The problem is that we can read form value only after full upload complete, so can't save the traffic that way. There is a solution, but once again not secure.
But as soon as so many users requesting it I will implement this soon. |
|
| Back to top |
|
 |
|