Get The Human Readable Size of The File

FileSize

Get the Human readable size of the file. It is purely written in dart and support both number and string as parameters.

Examples

getSize(string or number, {PrecisionValue}): returns String

  • Direct Method Call
FileSize.getSize(1000)               '1.00 KB'
FileSize.getSize(1048576)            '1.04 MB'
FileSize.getSize(1073741824)         '1.00 GB'
FileSize.getSize(1099511627776)      '1.00 TB'
  • Method call with PrecisionValue [Optional]
FileSize.getSize(664365320, PrecisionValue.THREE)      "633.588 MB"
FileSize.getSize(4324324232343, PrecisionValue.FOUR)   "3.9321 TB"
  • Method call without decimal value
FileSize.getSize(664365320, PrecisionValue.NONE)         "633 MB"
FileSize.getSize(4324324232343, PrecisionValue.NONE)     "3 TB"

getKiloBytes(string or number, {PrecisionValue}): returns String

FileSize.getKiloBytes(54613)      '54.61 KB'

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add file_sizes

With Flutter:

 $ flutter pub add file_sizes

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  file_sizes: ^1.0.6

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:file_sizes/file_sizes.dart'; 

example/main.dart

import 'package:file_sizes/file_sizes.dart';

void main() {
  /// Integer Values
  ///
  /// 12.06 KB
  print(FileSize.getSize(12345));

  /// 12.06 KB
  print(FileSize.getKiloBytes(12345));

  /// 12.05566 KB
  print(FileSize.getKiloBytes(12345, value: PrecisionValue.Five));

  /// 96450.712 KB
  print(FileSize.getKiloBytes(98765532, value: PrecisionValue.Three));

  /// String Values
  ///
  /// 12.06 KB
  print(FileSize.getSize('12345'));

  /// 12.06 KB
  print(FileSize.getKiloBytes('12345'));

  /// 12.05566 KB
  print(FileSize.getKiloBytes('12345', value: PrecisionValue.Five));

  /// 96450.712 KB
  print(FileSize.getKiloBytes('98765532', value: PrecisionValue.Three));
} 

Download Details:

Author: AnmolSethi

Source Code: https://github.com/AnmolSethi/file_size

#dart 

What is GEEK

Buddha Community

Get The Human Readable Size of The File

I am Developer

1597559012

Multiple File Upload in Laravel 7, 6

in this post, i will show you easy steps for multiple file upload in laravel 7, 6.

As well as how to validate file type, size before uploading to database in laravel.

Laravel 7/6 Multiple File Upload

You can easily upload multiple file with validation in laravel application using the following steps:

  1. Download Laravel Fresh New Setup
  2. Setup Database Credentials
  3. Generate Migration & Model For File
  4. Make Route For File uploading
  5. Create File Controller & Methods
  6. Create Multiple File Blade View
  7. Run Development Server

https://www.tutsmake.com/laravel-6-multiple-file-upload-with-validation-example/

#laravel multiple file upload validation #multiple file upload in laravel 7 #multiple file upload in laravel 6 #upload multiple files laravel 7 #upload multiple files in laravel 6 #upload multiple files php laravel

Osiki  Douglas

Osiki Douglas

1624740780

How to Check File and Folder Size in Python?

In this article, you’ll learn to check the size of a file or folder in Python

Python is one of the most versatile programming languages. With it, you’ll be able to build from a small CLI (Command-line interface) program to a complex web application.

However, one of its most underrated features is the capability to interact with operative systems. Managing OS operations with Python can save you tons of time when creating automation processes.

Let’s see how Python interacts with the OS.

#development #python #how to check file and folder size in python? #check file #folder size

How to Get Current URL in Laravel

In this small post we will see how to get current url in laravel, if you want to get current page url in laravel then we can use many method such type current(), full(), request(), url().

Here i will give you all example to get current page url in laravel, in this example i have used helper and function as well as so let’s start example of how to get current url id in laravel.

Read More : How to Get Current URL in Laravel

https://websolutionstuff.com/post/how-to-get-current-url-in-laravel


Read More : Laravel Signature Pad Example

https://websolutionstuff.com/post/laravel-signature-pad-example

#how to get current url in laravel #laravel get current url #get current page url in laravel #find current url in laravel #get full url in laravel #how to get current url id in laravel

Dance on Human Pose Estimation Using Artificial Intelligence

Dance on Human Pose Estimation Using Artificial Intelligence with Complete Tutorial & Source Code Download Free.

A Human Pose Skeleton speaks to the direction of an individual in a graphical organization. Basically, it is a bunch of directions that can be associated with depict the posture of the individual. Every co-ordinate within the skeleton is understood as a neighborhood or a joint, or a keypoint. A substantial association between two sections is known as a couple.

#projects #artificial intelligence #ai based dance on human pose estimation #dance on human pose estimation #dance on human pose estimation ai project #dance on human pose estimation using artificial intelligence #download code dance on human pose estimation ai project

How To Delete File From Public Folder In Laravel

In this post we will see how to remove/delete file from public storage, today I will give you demo how to remove file from storage folder in laravel.

So, here I will explain how to delete image from storage folder using Laravel File System and php function file_exists() and unlink().

How To Delete File From Public Folder In Laravel

https://websolutionstuff.com/post/how-to-delete-file-from-public-folder-in-laravel

#how to delete file from public folder in laravel #laravel #php #file #how to delete file from storage folder in laravel #laravel 6 remove file from public folder