In the following videos, we will create articles and upload files using each of the file sources. Let's first take a look at the default behavior of a filefield, which is to upload a file to the server from your local machine.
Default File Field Behavior
- Go to “Content => Add content = > Article” (node/add/article)
- Title: Article #1
- Body: (Lorem Ipsum)
Scroll down below the body and image fields to see File Upload Field. The first option is the default behavior of file fields. You can select an image from your local machine and upload it to the site.
- Click “Choose Files” (Now, we see my local directory structure where we can select some files to upload)
- Select “Sample.pdf”)
- Click “open”
- Click “Upload”
- File Information: (Here we can see the list of files that we have uploaded, Click “Remove”, if you have uploaded a wrong file)
- (Save)
Now, if we check our Drupal files folder at "sites/default/files/articles/uploads", we'll see the sample.pdf file that has been uploaded. This is where all of our files will be saved to, so we'll check back after we create each article.
Let's take a look at our first new option which is to select a file from a remote source instead of our local machine.