SibSoft Ltd.
Development Services
software products
 RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
EZYWebhost - Cheap XUpload & XFileSharing 100% campatible hosting

AJAX upload progress bar

File sharing script
set max_file_size within form

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload
View previous topic :: View next topic  
Author Message
golgotha



Joined: 18 Nov 2006
Posts: 3

PostPosted: Nov 18, 2006 1:37 pm    Post subject: set max_file_size within form Reply with quote

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
View user's profile Send private message
rob1984



Joined: 16 Nov 2006
Posts: 8

PostPosted: Nov 18, 2006 6:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Nov 20, 2006 6:21 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
golgotha



Joined: 18 Nov 2006
Posts: 3

PostPosted: Nov 20, 2006 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Nov 20, 2006 12:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
chrisdpucci



Joined: 11 Oct 2006
Posts: 9

PostPosted: Nov 20, 2006 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
golgotha



Joined: 18 Nov 2006
Posts: 3

PostPosted: Nov 21, 2006 1:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Nov 22, 2006 7:03 am    Post subject: Reply with quote

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).
Smile
Back to top
View user's profile Send private message Visit poster's website AIM Address
Ceroscuro



Joined: 23 Nov 2006
Posts: 2

PostPosted: Nov 23, 2006 11:39 pm    Post subject: Reply with quote

How would you go about setting this just from a value within the form?
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Nov 24, 2006 6:41 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group