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 6778671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:17:36+00:00 2026-05-26T16:17:36+00:00

I’m facing a simple problem I would like to get a local path from

  • 0

I’m facing a simple problem
I would like to get a local path from the end-user of my web application. I need only that and not to actually upload a file. (I know there are fileUpload tags in seam or in Primefaces but I just need the local full path as I’m uploading directly to Picasa Web Albums via the Google API)

In other words I would like to bind some kind of html tag : input type=”file”
to a bean property (I notice that the JSF tag h:inputText tag doesn’t have a type attribute)
Any ideas?

Env : JBoss AS 5.1, JSF1.2, Seam 2.2, Primefaces 1.1

Edit : here is my working solution

Thanks to the answers, I implemented the use-case of uploading a file directly to Picasa

    <h:form prependId="false" enctype="multipart/form-data">
        <s:fileUpload id="fileUpload"
                data="#{picasa.incomingFile}"
                contentType="#{picasa.fileType}"/>
        <h:inputText id="albumId"
                value="#{picasa.albumId}" />
        <h:commandLink action="#{picasa.upload()}"
                value="Upload">
            <f:param name="s"
                    value="#{subjectHome.id}"/>
        </h:commandLink>
    </h:form>

and the component code

@Name("picasa")
public class PicasaService {

    @Logger private Log log;

    private PicasawebService service;
    private InputStream incomingFile;
    private String fileType;
    private String albumId;



    @Create
    public void setUp()
    {
        service = new PicasawebService("picasaService");
        try {
            service.setUserCredentials("xxx@yyyy.zzz", "password");
        } catch (AuthenticationException e) {
            e.printStackTrace();
        }
    }

    public void upload()
    {
        URL albumUrl;
        PhotoEntry returnedPhoto;
        try {
            albumUrl = new URL("https://picasaweb.google.com/data/feed/api/user/default/albumid/" + albumId);
            MediaStreamSource myMedia = new MediaStreamSource(incomingFile , this.fileType);
            returnedPhoto = service.insert(albumUrl, PhotoEntry.class, myMedia);
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ServiceException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

This way, it seems to me that the file is not transferred twice (one from end-user machine to my web app’s server and from there to picasa WA server).

Hope this helps

  • 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-05-26T16:17:37+00:00Added an answer on May 26, 2026 at 4:17 pm

    but I just need the local full path as I’m uploading directly to Picasa Web Albums via the Google API

    You need to get the file’s content as an InputStream from the JSF file upload component and write it to an FileOutputStream on the server’s local disk file system the usual way, then you can reference it as a File and pass it to the Picasa API as documented.

    See also:

    • What is the alternative of file browse in JSF?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am currently running into a problem where an element is coming back from
I need to clean up various Word 'smart' characters in user input, including but
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.