To synchronize media with AnkiWeb and mobile clients, a few extra steps are required the first time. The process is free and relatively simple.
Automatic Dropbox Syncing
Dropbox are a company that provide online synchronization and backup of your files. They provide a generous amount of space for free, which you will not exceed just by using Anki.
Unfortunately the Chinese government have blocked Dropbox in China, so if you are living in China you’ll need to skip to the manual setup section below.
Step 1: Get Dropbox
Visit https://www.dropbox.com/ and follow the instructions to install Dropbox. After it opens, sign up for a new account.
Step 2: Fix Dropbox issues
If you’re on a Mac or Linux computer, and you did not customize the Dropbox folder location, you can skip this step. Otherwise, please read on.
In Oct 2011 Dropbox made some changes which broke Anki’s media support. To fix this, please open Anki and go to File>Download>Shared plugin. Search for "dropbox" and install the "fix dropbox" plugin.
If you’re using the standard Dropbox folder location, no further action is necessary. Please skip to the next step.
If you’ve customized the folder location, you will need to go to Settings>Plugins>Open plugin folder in Anki, and edit the plugin’s .py file in a text editor. Remove the # on the commented line, and replace the example with the path to your Dropbox folder.
Step 3: Tell Anki
In Anki, go to Settings>Preferences (or Anki>Preferences on a Mac). Near the bottom of the window, you’ll see a section labeled "Media". Click the selection box, and change "Keep media next to the deck" to "Keep media in Dropbox".
When you close the window, you’ll be returned to the deck list. After opening your deck again, Anki will take you to your Dropbox and ask you to copy its public link. Once you’ve done this, the setup process is complete, and after you File>Sync, your media will show up in AnkiWeb.
Please note that it can take Dropbox minutes or hours to upload all your media, so please wait until it has finished synchronizing before you attempt to use media on in AnkiWeb or the mobile clients.
If you sync other decks in the future, they will be automatically set up - there is no need to go through the above two steps again.
Note that if you have multiple desktop machines that you want to keep in sync, you’ll need to follow the above steps again on each separate machine.
Manual Setup
If you want to use something other than Dropbox, you’ll need to follow these steps. AnkiWeb and the mobile clients can read media from any website that doesn’t require authentication, so you can host your media on a personal website and use a different file synchronization service if you choose.
Let’s imagine you have a personal website at http://example.com, and a deck called stuff.anki, with its media stored in stuff.media. To use this media in AnkiWeb, copy the media to your website, so it is available at say http://example.com/stuff.media
Then visit Settings>Deck Properties and paste http://example.com/stuff.media into the Media URL field. After a File>Sync, the media should become visible in AnkiWeb.
If you are using an alternative synchronization service, you may want to have your media automatically uploaded without having to copy it from next to your deck. To do this, visit the preferences dialog and change "Keep media next to the deck" to "Keep media in a custom folder". The folder should be the prefix, so if you specify c:\syncedfiles, Anki will create c:\syncedfiles\stuff.media.
Problems
If you can’t see images on the desktop, please read the plugin migration section.
If images and audio are not working in AnkiMobile, please:
-
Ensure you’ve waited for Dropbox to finish uploading all your media
-
Tools>Advanced>Check Media DB. Even if it reports no errors, it has rebuilt your media database, so please continue with the rest of the steps.
-
Tools>Advanced>Check DB. Again, please continue even if no errors are reported.
-
File>Sync
-
On your device, sync or download the deck, and AnkiMobile should start downloading the media after it has downloaded the deck.
Limitations
AnkiWeb’s audio player only supports mp3 files, and can’t handle anything but the English alphabet in paths to the media files. If your media folder or the names of the mp3 files contain foreign characters, spaces, or certain punctuation, the audio will not play. You will still be able to use it in the desktop and mobile clients however.
Syncing doesn’t currently work with filenames that are percent-encoded (eg, they have percentage signs and numbers in them, and look like "file%20name.jpg" on your local computer), because Anki expects well-behaving programs to store files in their native characters instead of the encoded form. Anki should be made to handle these files in the future, but for now you’ll need to rename the files to not include percent-escapes and then check the media DB again. If you’re using AnkiMobile or AnkiDroid, you could also copy the media directly via iTunes or your SD card.
Troubleshooting
If you’ve followed all the steps in the "Problems" section above, then please check the following, and the report the results of each on the help forum.
-
In the Anki Preferences screen (Settings>Preferences if you’re not on a Mac), what is media set to?
-
In Settings>Deck Properties, what is the media URL set to?
-
Open your Dropbox folder, go into the Public folder, and then locate a yourdeck.media folder. Inside, there should be at least one or more media files if your deck contains media. Copy down one of the filenames.
-
If you append a filename to a media URL, so you end up with something like http://dl.dropbox.com/u12345/mydeck.media/image.jpg, and then paste that link into a web browser, does the image appear, or the sound download? If you get a 404 message, then something is wrong with your Dropbox installation.
-
If media works on an iPhone/Android phone but not on AnkiWeb, see the limitations section above.
-
If media works on AnkiWeb but not on the iPhone, try restarting your phone or downloading the deck again. If the problems persist then you probably missed a step in the problems section above.