status(su, "Upload successful.");
status(su, StatusUpdate.LEVEL_UPLOAD_ONE, "Upload successful.");
		boolean uploadPicture(Picture p) {			try	{				boolean escapeCaptions = GalleryRemote.getInstance().properties.getBooleanProperty(HTML_ESCAPE_CAPTIONS);				// can't set null as an NVPair value				String caption = p.getCaption();				caption = (caption == null) ? "" : caption;				if (escapeCaptions) {					caption = HTMLEscaper.escape(caption);				}				// setup the protocol parameters				NVPair[] opts = {					new NVPair("cmd", "add-item"),					new NVPair("protocol_version", PROTOCOL_VERSION),					new NVPair("set_albumName", p.getAlbum().getName()),					new NVPair("caption", caption )				};				// set up extra fields				if (p.getExtraFieldsMap() != null && p.getExtraFieldsMap().size() > 0) {					ArrayList optsList = new ArrayList(Arrays.asList(opts));					Iterator it = p.getExtraFieldsMap().keySet().iterator();					while (it.hasNext()) {						String name = (String) it.next();						String value = p.getExtraField(name);						if (value != null) {							if (escapeCaptions) {								value = HTMLEscaper.escape(value);							}							optsList.add(new NVPair("extrafield_" + name, value));						}					}					opts = (NVPair[]) optsList.toArray(opts);				}				Log.log(Log.TRACE, MODULE, "add-item parameters: " + Arrays.asList(opts));								// setup the multipart form data				NVPair[] afile = { new NVPair("userfile", p.getUploadSource().getAbsolutePath()) };				NVPair[] hdrs = new NVPair[1];				byte[]   data = Codecs.mpFormDataEncode(opts, afile, hdrs);								// load and validate the response				Properties props = requestResponse( hdrs, data, g.getGalleryUrl(SCRIPT_NAME), true );				if ( props.getProperty( "status" ).equals(GR_STAT_SUCCESS) ) {					status(su, "Upload successful.");					return true;				} else {					error(su, "Upload error: " + props.getProperty( "status_text" ));					return false;				}							} catch ( GR2Exception gr2e ) {				Log.logException(Log.ERROR, MODULE, gr2e );				error(su, "Error: " + gr2e.getMessage());			} catch (SocketException swe) {				Log.logException(Log.ERROR, MODULE, swe);				error(su, "You may need to set LimitRequestBody 16777216 and memory_limit = 64M " +						"in /etc/php.ini and /etc/httpd/conf.d/php.conf on your Gallery server\n\n" +						swe.toString());			} catch (IOException ioe)	{				Log.logException(Log.ERROR, MODULE, ioe);				error(su, "Error: " + ioe.toString());			} catch (ModuleException me) {				Log.logException(Log.ERROR, MODULE, me);				error(su, "Error handling request: " + me.getMessage());			}								return false;		}