Tag : File

ItSolutionStuff.com have tutorials for File tag, here you can study articles of File tag, File tag posts collection, most popular and useful tutorials of File tag, here you can find list of all relevant posts and example about File tag, we have lists of tutorials and examples about File tag. very simple and quick example collection of Latest File tag.

Laravel Vue JS File Upload Using vue-dropzone Example

When we require to add drag and drop file upload then we always choose dropzone js for that because it is awesome. So in this tutorial, i would like to share with you vue js file upload using vue-dropzone component in laravel. basically, you can also use dropzone js in your vue js script. Here, i create example step by step of vue.js dropzone image or file uploading. We will go from scratch so, first we will download laravel 5.6 and then we will initialize vue js then install vue-dropzone package. After that we will create one post route and one controller with one method. We will create POST.....

By Hardik Savani | August 11, 2018 | | 3262 Viewer | Category : PHP Laravel Vue.JS

How to get size of directory in MB Laravel 5?

Mostly we require to calculate for uploaded directory size because we can see how much we size allocate in uploaded directory. If you have limited server then you always need to check how much size of data in my folder. You can also get size of directory that way you can also display on your admin panel. Laravel provide File facade. File facade through we can get folder size in kb or mb or gb etc. In bellow example i have <strong class="path">images directory</strong> in public folder. so we can get size for images folder like this way : <strong>Example:</strong> <pre class="prettyprint la.....

By Hardik Savani | July 23, 2016 | | 23958 Viewer | Category : Laravel

How to get file size from URL in Laravel 5?

We sometimes require to get file size from path in laravel, so if you need to get file size from url then no worry and you can get using File facade. File facade provide several function that way we can get size of file or image. In bellow example i just give you path of my images folder inside public folder and one image, that give path as argument of size function: <strong>Example:</strong> <pre class="prettyprint lang-php"> {{ File::size(public_path('images/1461177230.jpg')) }} </pre>

By Hardik Savani | July 18, 2016 | | 24548 Viewer | Category : Laravel

How to get folder path from file path in PHP?

Sometimes, we require to get directory path from Image path or file url in our PHP website or any PHP framework website at that time we can get folder name using php pre-define function dirname. If you ever use this function then you can see as bellow example how it's works. I have one image url like, i want to just get folder path then you can get folder path like this way : <strong>Example:</strong> <pre class="prettyprint lang-php"> dirname('http://localhost:8000/upload/images/test.jpg'); </pre>

By Hardik Savani | July 4, 2016 | | 15610 Viewer | Category : PHP

How to get filename without extension in PHP?

If you need to get just filename from url withour file extension then you can get that using basename() php function. In bellow example i give you how to get image name without extension. first we need to get extension of given filename url and then basename() through we can remove that extension like as i did bellow: <strong>Example:</strong> <pre class="prettyprint lang-php"> $imagePath = "/home/hd/html/test.jpg"; $ext = pathinfo($imagePath, PATHINFO_EXTENSION); <br/> $file = basename($imagePath,".".$ext); print_r($file); </pre>

By Hardik Savani | May 26, 2016 | | 19497 Viewer | Category : PHP

Laravel 5 create and download zip file example using chumper/zipper composer package

Sometimes, we need to create file of our project directory and give to download that zip file to users. we are always prefer zip file because it is very safe and secure from virus. If you want to generate zip file and donwload that file in your laravel 5 application then you do it easily using chumper/zipper composer package. In this post i give you example to create zip file and donwload from scratch. So first we have to follow bellow step for install package. First fire following command on your terminal. <strong>Installation Package</strong> <pre>composer require chumper/zipper</pre> After.....

By Hardik Savani | May 10, 2016 | | 98871 Viewer | Category : Laravel

How to check file is exists or not in PHP?

If you need to check file is exixt or not on folder. Normally we require to check image is exist or not, video is exists or not etc. In this example i use file_exists() for determine file is available or not in given path. So if you also need check then follow bellow example: <strong>Example:</strong> <pre class="prettyprint lang-php"> if(file_exists('./upload/flower.jpg')){ print_r('Image is exist.'); }else{ print_r('Image is not exist.'); } </pre>

By Hardik Savani | April 26, 2016 | | 16520 Viewer | Category : PHP

How to check if file exists or not in Laravel 5?

Nowdays laravel framework is popular framework in PHP Language. So, if you required to check if file is exists or not in given path then you can check eisily. Normally we always need to check if image exists, check if pdf file exists, check if docs exists or not etc. I give you two way to check file is Exists or not. one using file_exists() and second one using File facade of laravel 5. it's better if you preffer File facade example. So, let's see and implement: <strong>Example 1:</strong> <pre class="prettyprint lang-php"> if(file_exists(public_path('images/1461177230.jpg'))){ dd('File i.....

By Hardik Savani | April 23, 2016 | | 38995 Viewer | Category : Laravel

How to check if View Exists or not in Laravel 5?

In some situations, we require to check if view exists then render view otherwise display something else. But you can perform this task using "exists" function of view helper. It will return true or false. So you can use bellow example. <strong class="example">Example:</strong> <pre class="prettyprint lang-php"> if (view()->exists('users.index')) { .... } </pre>

By Hardik Savani | April 12, 2016 | | 18182 Viewer | Category : Laravel

How to recursively change the permissions of files and directories in ubuntu?

Sometimes, we need to give recursively change the permissions of specific files and directories in ubuntu OS. you can open terminal and run bellow command, so let's try this way : <strong class="example">Example</strong> <pre>sudo find foldername -exec chmod a+rwx {} ";"</pre> Give more specific! <pre>sudo find foldername -type d -exec chmod 755 {} ";"</pre> <pre>sudo find foldername -type f -exec chmod 644 {} ";"</pre>

By Hardik Savani | April 6, 2016 | | 15416 Viewer | Category : Ubuntu