File size limit - Forum

Forum Navigation
You need to log in to create posts and topics.

File size limit

Hi..

I will use in my platform the ability the User to upload up to 3 image files and for that reason i use the following commands:

LocalBinaryFileToBase64Var

neoPhpFileWriteFromBase64

There is any way to limit the file size of uploaded file ?

I use FileInput object to select the image file, i have set the max-length property 50000 for 50kb but is not seems to working. Also there is a property capture, what is the purpose of it ? Help file doesn't say anything. Property-name is not accept numeric, i test to put Image1 and the button is not playing.

PS. I notice also that FileInput is not respond to any class, for example i put in row and doesn't do anything.

Thanks

 

There is any way to limit the file size of uploaded file ?

@smartmedia as this is a PHP command you should check php.ini file.

In PHP, you can limit the file upload size by setting the upload_max_filesize and post_max_size directives in your php.ini file. These directives determine the maximum size of uploaded files and the maximum amount of data that can be sent via POST method respectively.

Alternatively or in addition, you can also check the Variable size before sending it to the server with neoPhpFileWriteFromBase64.

Also there is a property capture, what is the purpose of it ?

The capture attribute is only used when the accept attribute is set to "image/*" or "video/*",it allows you to select the rear or front camera.

Property-name is not accept numeric, i test to put Image1 and the button is not playing.

That's because you already have an object with "Image1" name. Try using a name different to any other object you already have in your app.

Regards.

smartmedia has reacted to this post.
smartmedia
Quote from luishp on March 22, 2023, 7:42 pm

Alternatively or in addition, you can also check the Variable size before sending it to the server with neoPhpFileWriteFromBase64

In php.ini says that:

;This configuration file will be copied to each project everytime the server starts.
;and will be removed automatically everytime the server stops.

So every time i close the local server php.ini disappears. On the Web server will stay forever ?

What command i must use to take variable size ? will be in bytes ?

What is important is that FileInput object doesn't accept any class so i can't put it in specific position. Any work around on that ?

So every time i close the local server php.ini disappears. On the Web server will stay forever ?

@smartmedia You can customize the php.ini template as it's the one that will be copied each time to your projects.
This file configures PHP behaviour and the one you can find with neoPhp Server it's specialy designed to work with neoPhp Server and VisualNEO Web.
On your real hosting service you can create or modify your own one.
More information about php.ini file here:
https://www.geeksforgeeks.org/what-is-the-purpose-of-php-ini-file/

What command i must use to take variable size ? will be in bytes ?

StrLen. or [myvar.lenght] Yes, in bytes.

What is important is that FileInput object doesn't accept any class so i can't put it in specific position. Any work around on that ?

Sorry, I don't understand you

 

smartmedia has reacted to this post.
smartmedia

Hi @luishp,

Thanks for the answer, StrLen. or [myvar.lenght] rerurn the size but it seems that is over sized. For example a file that shows 852kb and on disk 870kb the [myvar.lenght] rerurn 1160411 bytes / 1024 make us 1133kb.

As far is concern the FileInput object, my app is responsive and i use the FileInput in a page so the user press it and choose a file, now when a put a row class it doesn't do anything, or if i align it on Top the same result.

Thanks for the answer, StrLen. or [myvar.lenght] rerurn the size but it seems that is over sized. For example a file that shows 852kb and on disk 870kb the [myvar.lenght] rerurn 1160411 bytes / 1024 make us 1133kb.

Yes, that's because Base64 encoded images are about 20% greater than in binary format.

As far is concern the FileInput object, my app is responsive and i use the FileInput in a page so the user press it and choose a file, now when a put a row class it doesn't do anything, or if i align it on Top the same result.

Well, I now understad. The reasons for that behaviour are a bit odd, but you can add this CSS to your project to fix it:

#FileInput1{
   position:static!important;
}

Just change FileInput1 with your own File Input object name.

smartmedia has reacted to this post.
smartmedia