Max File Size When Uploading File !

Hello moderator, I have a problem here, and I hope somebody can help me
Am trying to make an upload form for file like doc,docx,

and am getting trouble for limiting file size upload
for example, the user can’t upload file more than 5 mb, can some one help me please?

I working on scriptcase 8.

There is a setting in the scriptcase preferences, in your php.ini and if it goes into mysql directory also myslq ini file. So lots of options to search for… But no direct answer as it depends on your system.

So there’s no on event php code? before insert for example?
I have tried all of your suggestion, and still no luck,
please someone help me.

@Albert, where is the SC setting in the preferences ? Can’t find it. @kousaka, Please state exactly which version of SC you are using (there was a bug with uploading files exceeding 10mb in the previous version ScriptCase v8.1.051 (2016-09-19 14:39))

what is the error you are getting ? Run the application in debug mode :
Application–>settings–>Error Settings [ATTACH=CONFIG]n72866[/ATTACH]

Edit: Found the Maximum File Size attribute in Application–>Settings for the application.
Per the field description : [TABLE=“class: nmTable form_tab_id_blk_lnk_opn_desktop_general, cellpadding: 0, cellspacing: 0, width: 1113”]
[TR]
[TD=“class: nmLineV3”] [/TD]
[TD=“class: nmLineDesc”]Set the upload maximum file size. Same from upload policy: exemple: upload_max_filesize=512M[/TD]
[/TR]
[/TABLE]

  • [B]Maximum file size -[/B] Set the upload maximum file size for image or document field.

debug.png

@leonvz
my scriptcase version [SIZE=12px]Installed version[/SIZE][SIZE=12px]8.01.0044 [/SIZE][SIZE=12px]Last version8.01.0052

umm, actually there’s no error when uploading, the problem is, how to read the size of file upload, so that I can limit the file upload size.
it [/SIZE]apparently doesn’t work on SC,

if in native php you can use $_FILES[‘filename’][‘size’] to get the size of file, but how about SC? Really it make me sick :frowning:
please help.

@leonvz I have tried upload_max_filesize=512M and I have changed it to 2M (is it mean 2Mb?)
note : I have change upload size in php.ini too. well it doesn’t work either.

Is it a Document(Database) or Document(Field Name) field ?

It’s Document(Field Name)

Interesting… Because SC takes care of processing the file (hence can’t use $_FILES[‘filename’][‘size’])
You should expect a Message to pop up if the file exceeds the Maximum file size attribute. Nothing happens , the file is uploaded even if it exceeds the max.I have just tested it with one of my own apps with the settings below. Are we setting it incorrectly ?

[ATTACH=CONFIG]n72872[/ATTACH]

max.png

Maximum File Size attribute in Application does nothing ?
Check this post it gives the answer: http://www.scriptcase.net/forum/foru…oad-size-limit

I’ve readed that theread before, and the audience still waiting for the answer, where is the scriptcase experts here? Please Help…

MAYBE you should go back and read it again…The thread has a workaround

Okay, it’s work on beforeinsert event, but on beforeupdate event I got this error,

“Undefined property Undefined property: form_dosen_apl::$SC_IMG_foto”

note : form_dosen_apl is my form aplication name, and foto is my field name for photo.
anybody can help?

I had the same problem
The problem was my php.ini file
Its now set to
upload_max_filesize = 5M (was set to 2M)
Post_max_size = 8M (needs to be higher than the above)

I’ve also set the max_file_uploads = 20 (the maximum amount of files there can be uploaded per request)

Hope it might help …