I got the following code in my jsp
<%@ page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory" %>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreService" %>
<%@ page import="com.google.appengine.api.blobstore.UploadOptions" %>
<%
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
String uploadUrl = blobstoreService.createUploadUrl("/test.jsp", UploadOptions.Builder.withGoogleStorageBucketName("my_bucket"));
%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Upload Page</title>
</head>
<body>
<h1>Upload v1</h1>
<form name="form1" id="form1" action="<% out.print(uploadUrl); %>" method="post" enctype="multipart/form-data" target="upload_iframe">
<input type="hidden" name="hiddenfield1" value="ok">
Files to upload:
<br/>
<input type="file" name="myFile">
<br/>
<button type="submit">Send</button>
</form>
<iframe id="upload_iframe" name="upload_iframe"></iframe>
</body>
</html>
i also set my bucket at public read like this:
python c:\gsutil\gsutil setacl public-read gs://my_bucket
My ACL file looks like this:
<?xml version="1.0" ?>
<AccessControlList>
<Owner>
<ID>00b4903a97dfaa16aff41eeb91e90b5fb524f1daf0d88fceca29b6f647412e8d</ID>
</Owner>
<Entries>
<Entry>
<Scope type="GroupById">
<ID>00b4903a97dfaa16aff41eeb91e90b5fb524f1daf0d88fceca29b6f647412e8d</ID>
</Scope>
<Permission>FULL_CONTROL</Permission>
</Entry>
<Entry>
<Scope type="GroupById">
<ID>00b4903a97d3721750cd84cf5e8be336cba9847dba5c2e4a1e88aa514db970d2</ID>
</Scope>
<Permission>FULL_CONTROL</Permission>
</Entry>
<Entry>
<Scope type="GroupById">
<ID>00b4903a97c265aa840305b07236a7ea78681916c9e63ab74c0deb237f60f05e</ID>
</Scope>
<Permission>READ</Permission>
</Entry>
<Entry>
<Scope type="UserByEmail">
<EmailAddress>
[email protected]
</EmailAddress>
</Scope>
<Permission>
WRITE
</Permission>
</Entry>
</Entries>
</AccessControlList>
And now each time i upload i get a error: 503 Service Unavailable