public static boolean uploadDataSource(String devId, String devName, String channels, String channelSpecs, String data){
		HttpEntity reqEntity = null;
		MultipartEntity mPartEntity;
		if (data.length() > 1024){//require at least a killobyte... just too costly for small data sizes
			try{
		    	mPartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
		    	mPartEntity.addPart("device_id", new StringBody(devId));
		    	mPartEntity.addPart("timezone", new StringBody("UTC"));
		    	mPartEntity.addPart("device_class", new StringBody("USGS"));
		    	mPartEntity.addPart("dev_nickname", new StringBody(devName));
		    	mPartEntity.addPart("channel_names", new StringBody(channels));
		    	if (channelSpecs != null)
		    		mPartEntity.addPart("channel_specs", new StringBody(channelSpecs));
			    mPartEntity.addPart("data", new StringBody(data));
			}
			catch (Exception e){
				System.out.println("failed to create data upload stuff");
				return false;
			}
			reqEntity = mPartEntity;
		}
		else{
	    
		
			List<NameValuePair> postParams = new LinkedList<NameValuePair>();
			postParams.add(new BasicNameValuePair("device_id",devId));
			postParams.add(new BasicNameValuePair("timezone","UTC"));
			postParams.add(new BasicNameValuePair("device_class","AirNowDataSource"));
			postParams.add(new BasicNameValuePair("dev_nickname", devName));
			postParams.add(new BasicNameValuePair("channel_names", channels));
			if (channelSpecs != null)
				postParams.add(new BasicNameValuePair("chnanel_specs", channelSpecs));
			postParams.add(new BasicNameValuePair("data", data));
			try {
				reqEntity = new UrlEncodedFormEntity(postParams);
			} catch (UnsupportedEncodingException e1) {
				System.out.println("failed to create data upload stuff");
				return false;
			}
		}
		
    	HttpClient mHttpClient = new DefaultHttpClient();
    	HttpPost postToServer = new HttpPost("http://" + btHost + "/users/" + siteUID + "/upload");
		postToServer.setEntity(reqEntity);
		HttpResponse response;
		try {
			response = mHttpClient.execute(postToServer);
		} catch (Exception e){
			System.out.println("Failed to upload to server!");
			return false;
		}
		int statusCode = response.getStatusLine().getStatusCode();
		long bytes = data.length();
		long overhead = reqEntity.getContentLength() - bytes;
		if (statusCode >= 200 && statusCode < 300){
    		System.out.println("Upload success!");
		}
		else{
			System.out.println("Upload failed! " + statusCode);
			return false;
		}
		System.out.println("data: " + bytes);
		System.out.println("overhead: " + overhead);
		return true;
	}