/** * Generates an <b>unauthenticated</b> HTML POST form that can be used to * upload files or data to S3 from a standard web browser. * <p> * Because the generated form is unauthenticated, it will not contain a * policy document and will only allow uploads to be sent to S3 buckets * that are publicly writable. * * @param bucketName * the name of the target bucket to which the data will be uploaded. * @param key * the key name for the object that will store the data. The key name can * include the special variable <tt>${filename}</tt> which expands to the * name of the file the user uploaded in the form. * @return * A form document that can be included in a UTF-8 encoded HTML web page * to allow uploads to a publicly-writable S3 bucket via a web browser. * * @throws S3ServiceException * @throws UnsupportedEncodingException */ public static String buildPostForm(String bucketName, String key) throws S3ServiceException, UnsupportedEncodingException { return buildPostForm(bucketName, key, null, null, null, null, null, true); }
/** * Generates an <b>unauthenticated</b> HTML POST form that can be used to * upload files or data to S3 from a standard web browser. * <p> * Because the generated form is unauthenticated, it will not contain a * policy document and will only allow uploads to be sent to S3 buckets * that are publicly writable. * * @param bucketName * the name of the target bucket to which the data will be uploaded. * @param key * the key name for the object that will store the data. The key name can * include the special variable <tt>${filename}</tt> which expands to the * name of the file the user uploaded in the form. * @return * A form document that can be included in a UTF-8 encoded HTML web page * to allow uploads to a publicly-writable S3 bucket via a web browser. * * @throws S3ServiceException * @throws UnsupportedEncodingException */ public static String buildPostForm(String bucketName, String key) throws S3ServiceException, UnsupportedEncodingException { return buildPostForm(bucketName, key, null, null, null, null, null, true); }
throws S3ServiceException, UnsupportedEncodingException return buildPostForm(bucketName, key, credentials, expiration, conditions, inputFields, textInput, isSecureHttp, false, "Upload to Amazon S3");
throws S3ServiceException, UnsupportedEncodingException return buildPostForm(bucketName, key, credentials, expiration, conditions, inputFields, textInput, isSecureHttp, false, "Upload to Amazon S3");
S3Service.buildPostForm("public-bucket", "${filename}"); String restrictedForm = S3Service.buildPostForm( BUCKET_NAME, key, awsCredentials, expiration, conditions, inputFields, null, true);
S3Service.buildPostForm("public-bucket", "${filename}"); String restrictedForm = S3Service.buildPostForm( BUCKET_NAME, key, awsCredentials, expiration, conditions, inputFields, null, true);