Scenario/Problem: You want to upload a file to a document library in a SharePoint site.
Solution:
Uploading a file to SharePoint is an easy process. There are three ways
to do so. If you are writing a document in a Microsoft Office
application, an easy way is to upload the document straight from the
application by saving it directly into SharePoint.
If the file you want to upload is not an
Office file, or if you prefer to upload the file without opening it in
an Office application, you can upload the file using the web interface
with your Internet browser.
The third option, which is a bit
more advanced, enables you to upload the file to a library as if that
library were a folder on your computer. This method is known as using web folders,
and it requires that some components be installed on your machine. When
these components are installed, web folders are easy and efficient to
use.
Upload a File from the Web Interface
To upload a file from the web interface using
your web browser, you browse to the library to which you want to upload
the file, and then go to the folder where you want to put the file. If
you have the required permissions to add files to the folder, you will
see above the list of documents a New Document link and next to it text
that says “or drag files here” as shown in Figure 1.
FIGURE 6.1 The Files ribbon with the New Document and the Upload Document buttons.
You can either drag and drop one or more
files from your desktop into anywhere in the list view, or you can
click the New Document link in the list view or Upload Document button
in the ribbon. The different interaction options for each choice are
described in the following section.
Dragging and dropping is simple: locate the
files you want to upload in your file browser, select them, and drag
them onto the list view. The list view will change to say Drop Here,
and then you can release and drop the files. The list view then changes
to Uploading; when the upload completes, the list view changes to say
Upload Completed.
If you click the New
Document link in the list view, a dialog appears, allowing you to
create new files or upload an existing document as shown in Figure 2.
Click on the Upload Existing File link at the bottom of the dialog to
open another dialog that allows you to browse to an existing file as
shown in Figure 3. This dialog is the same one you will see if you click the Upload Document button in the Files ribbon shown in Figure 2. Using this dialog is described next as part of using the Upload Document button.
FIGURE 2 The Create a New File dialog opens when you click on the New Document link in the list view.
Clicking the Upload
Document button in the Files ribbon opens the Add a Document dialog,
where you can choose a single file by using the Browse button (see Figure 3).
FIGURE 3 The Add a Document dialog, with
the Upload Files Using Windows Explorer Instead link, enables you to
use regular copy-paste to the document library.
If you are using a compatible browser and
have the required components, the option in the Add a Document dialog
to upload multiple files using the Upload Files Using Windows Explorer
Instead link becomes available. This copy-paste button opens the
document library in a Windows explorer window, allowing you to copy
paste into the document library.
If you selected a single file, click OK to
commit the upload. This process can take a while, depending on the
speed of the network, the size of the file, and the load on the server.
When the upload is done, depending on the
setup of the document library, you might be prompted for properties for
the file and see a Save button (see Figure 4).
FIGURE 4 After the file is uploaded, you
might be prompted for more information about the file. In this example,
you are asked for information for the Title and Product columns.
Tip
If you change your mind about uploading the
document at this stage, you have two choices available in the dialog’s
ribbon: Cancel and Delete. If you cancel, the document is still in the
document library, but it stays checked out to you as a draft document.
If you choose Delete, the document is removed from the document library.
If the library supports multiple content
types for files, you might have to select what content type this file
belongs to, and that might change the properties that you are asked for
(see Figure 5).
FIGURE 5 The properties entry screen when the Presentation content type is selected.
If you uploaded multiple files using either
the drag-and-drop method or the Windows explorer copy-paste option, you
are not asked for properties for the files, and the files are all
uploaded but not checked in to the document library. You still need to
check in each file that you uploaded and set the properties for each
one separately.
Of course, if check-in is not
required on the document library in question, you don’t need to check
in the files, but setting the properties (for example, the titles for
the files) might be a good idea.