diff --git a/src/StatusBar.py b/src/StatusBar.py
index 1865db3..4cc7aed 100644
--- a/src/StatusBar.py
+++ b/src/StatusBar.py
@@ -46,6 +46,7 @@ class StatusBar(gtk.Label):
     def update_quota(self):
         """Call Flickr to get the current upload quota, and update the status bar."""
         def got_quota(rsp):
+            self.maxfile = int(rsp.find("user/filesize").get("maxmb"))
             if int(rsp.find("user").get("ispro")):
                 self.quota = None
             else:
diff --git a/src/postr.py b/src/postr.py
index 7351064..3b38f86 100644
--- a/src/postr.py
+++ b/src/postr.py
@@ -586,9 +586,9 @@ class Postr(UniqueApp):
             d.show_all()
             return
 
-        if filesize > 20 * 1024 * 1024:
+        if filesize > self.statusbar.maxfile * 1024 * 1024:
             d = ErrorDialog(self.window)
-            d.set_from_string("Image %s is too large, images must be no larger than 20MB in size." % filename)
+            d.set_from_string("Image %s is too large, images must be no larger than %dMB in size." % (filename, self.statusbar.maxfile))
             d.show_all()
             return
         
