How-to articles, tricks, and solutions about FILE

How to Create a File in Java

Learn 3 ways of creating files in Java with examples. Use java.io.File class, java.io.FileOutputStream class or Java NIO Files.write() class for creating new files in Java.

How to create a temporary directory/folder in Java?

To create a temporary directory/folder in Java, you can use the createTempDirectory() method of the Files class in the java.nio.file package.

How to Create Temporary File in Java

Learn the two static methods of createTempFile of the File class. Use the deleteOnExit() method to ensure that the temporary created file will automatically be deleted.

How to Download a File in PHP

PHP is a popular general-purpose scripting language. It provides files to the user by forcing them to download. Know how to download a file in PHP correctly.

How to Embed PDF in HTML

Learn how to embed PDF documents in HTML using the a and iframes tags, and make PDF files not downloadable with W3Docs. Practice with examples

How to Find a Deleted File in the Project Commit History in Git

This tutorial will help you find the answer to the question of finding a deleted file in the project commit history. Get the code and get the work done.

How to Find All Files Containing Specific Text on Linux

Learn How to Find All Files Containing Specific Text on Linux with W3docs tutorial. Also, try the examples yourself and see the results.

How to Force Git Pull to Override Local Files

This tutorial will show you how to force git pull in case of untracked files which will be overwritten. Find important tips to avoid unwanted mistakes.

How to Get a File Extension in PHP

Here, we have collected five simple and efficient ways that will help you to get a PHP file extension. Check out the examples and choose the best one.

How to Get File Extensions with JavaScript

Read this tutorial and learn several useful, fast and simple one-line and extended solutions of extracting file extensions with the help of JavaScript.

How to Get JavaScript Stack Trace When Throwing an Exception

Read this JavaScript tutorial and learn useful information about the two methods that are used in programming to get stack trace when throwing an exception.

How to Include a JavaScript File in Another JavaScript File

Read the tutorial and find out different approaches to including a JavaScript file in another JavaScript file. Also, find a brief representation of methods.

How to Increase the File Upload Size with PHP

Here, we will assist you in finding the best way to increase the file upload size with the help of PHP arsenal. Read it carefully and follow the examples.

How to move a file in Python?

In Python, you can use the shutil module to move a file.

How to read a file line-by-line into a list?

To read a file line-by-line into a list, you can use the following approach:

How to read all files in a folder from Java?

To read all the files in a folder from Java, you can use the File class from the java.io package to list all the files in a directory. Here's an example of how you can do this:

How to read file from relative path in Java project? java.io.File cannot find the path specified

To read a file from a relative path in a Java project, you can use the File class from the java.io package and specify the relative path to the file.

How to Remove Files from Folder with PHP

PHP does not have a specific undo for what you delete from anywhere. This snippet will represent how to remove files from folder permanently using PHP.

How to Remove Files from Git Commit

This tutorial will help you get the answer to the question of removing files from git commit based on different scenarios. Also, read about used commands.

How to Remove Untracked Files from the Current Working Tree in Git

While working with Git, it is sometimes necessary to get rid of local (untracked) files from your current Working Tree. Learn how to do it in this snippet.

How to Reset File Input with jQuery

In this tutorial, you will read and learn useful information about the fastest method of resetting a file input by using some HTML and jQuery methods.

How to Reset or Revert a File to a Specific Version in Git

There are cases when you need to revert or reset a file to a specific version. With the help of this tutorial you will easily manage it.

How to search and replace text in a file?

There are several ways to search and replace text in a file, depending on the programming language you are using.

How to Search Git branches for a File or Directory

Read this tutorial and learn what are the basic git commands that can suggest a solution to the problem of searching for a file of a directory by a path.

How to Stash an Untracked File in Git

Read this tutorial and solve the problem of stashing untracked files including ignored files in .gitignore. Find method presented by Git new versions.