Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8741995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:25:17+00:00 2026-06-13T11:25:17+00:00

The goal is to upload large file (video) and get the public shared url

  • 0

The goal is to upload large file (video) and get the public shared url for them.

Looks like it’s pretty straightforward but i spend a bit more than one day going into the documentation and i didn’t find any sample of that.

I get the following code to make an upload to Google Store which works fine, but i would like to add the option in the url to make the acl of the file : “public-read”. Either prior the upload in the jsp or after in the servlet.

<%@ 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("/ajax?act=user&act2=video_upload", UploadOptions.Builder.withGoogleStorageBucketName("vidaao"));

%>

<%@ 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 v3</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>

Then in my servlet somewhere the redirect url ends there with the generation of the blobkey

public String upload(HttpServletRequest req, HttpServletResponse res) throws Exception{

    Map<String, BlobKey> blobs = blobstoreService.getUploadedBlobs(req);
    BlobKey blobKey = blobs.get("myFile");

    if (blobKey == null) {

        throw new Exception("Error file not uploaded");

    }

            //TODO: HERE get the public shared url of the file

    return " blob key = " + blobKey.getKeyString();

}

And at this step i would like to have the public shared url for the Google Cloud Storage, if it’s possible.
(I cannot serve the file through a servlet because it might time out)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:25:18+00:00Added an answer on June 13, 2026 at 11:25 am

    By default files uploaded to bigstore using createUploadUrl are private. You would need to modify the ACL yourself to make it public.

    Also, you can use serve() to return blobs of unlimited size from Google Storage from your servlet without concerns for timeout if you would prefer to do it that way rather than making the blobs public.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm exploring the file upload and text parsing capabilities of PHP, but my first
I want to upload an image use something like <form ...> <input type=file id=upload></input>
My goal is to upload a file containing rows of firstname and lastname, parse
My goal is to upload a text file via HTTP post I am using
Goal is to make a dialog that appears on menu_key pressed, but it keeps
Goal I am building an Eclipse plugin targeting the 3.7 environment and would like
Goal My goal is to to get Twitter Bootstrap to worth with my Play
Using the asp.net file upload control is very easy, i'm trying to squeeze it
I use this code to upload image files in xammp server: <?php if ((($_FILES[file][type]
I'm sooo close... but I don't quite see the connection from the upload view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.