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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:37:11+00:00 2026-06-18T12:37:11+00:00

In my Flex Application i’m doing image Uploading Using Blazeds … private var fileReference:FileReference;

  • 0

In my Flex Application i’m doing image Uploading Using Blazeds …

    private var fileReference:FileReference;
        protected function imageUpload(event:MouseEvent):void
        {
            // create a fileFilter - class declaration
            var imageTypes:FileFilter;
            // set the file filter type - jpg/png/gif - init method             
            imageTypes = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");

            fileReference = new FileReference();

            fileReference.browse([imageTypes]);

            fileReference.addEventListener(Event.SELECT, browseImage);              
            fileReference.addEventListener(Event.COMPLETE, uploadImage);                
        }

        private function browseImage(event:Event):void {
            fileReference.load();
        }
        private function uploadImage(event:Event):void {
            profileImage.source = fileReference.data;

            var name:String = fileReference.name;
            var directory:String = "/EClassV1/flex_src/Images";
            var content:ByteArray = new ByteArray();
            fileReference.data.readBytes(content, 0, fileReference.data.length);
            var fileAsyn:AsyncToken = userService.uploadImage(name,directory,content);
            fileAsyn.addResponder(new mx.rpc.Responder(handler_success, handler_failure)); 
        }

And in my Java Code…

@RemotingInclude
public void uploadImage(String name, String directory, byte[] content) {
    File file = new File(directory);
    if (!file.exists()) {
        file.mkdir();
    }
    name = directory + "/" + name;
    File fileToUpload = new File(name);
    try {
        FileOutputStream fos = new FileOutputStream(fileToUpload);
        fos.write(content);
        System.out.println("file write successfully");
        fos.close();
    } catch (Exception ex) {
        ex.printStackTrace();
   }

}

But it giving… error..

java.io.FileNotFoundException: \EClassV1\flex_src\Images\image001.png (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)

Actually i want to Sore file into folder and store Database..
Help me..

  • 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-18T12:37:13+00:00Added an answer on June 18, 2026 at 12:37 pm

    You need to create the file if it does not exist yet. The method createNewFile() will do this for you:

    File fileToUpload = new File(name);
    fileToUpload.createNewFile();
    
    try {
        FileOutputStream oFile = new FileOutputStream(fileToUpload, false); 
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Flex Application doing Image upload for local system. Actually i'm using FileReference
In my Application using Flex-Blazeds-java...,in my Flex application side have two mxml file Main.mxml
My Flex application records audio-only FLV files using red5--I'd like to convert these to
I have a Flex application in which I draw a rectangle using: <s:Rect height=20
I have a flex application which is configured with blazeds sever and i am
I created flex application that loads a image. I compiled this app and ran
I'm developing a flex application and I want to access a component by using
I wrote a flex application that get the host string from the browser using
I'm building a Flex application using some custom components, which I think is messing
I'm building a Flex application where users can enter a URL to an image

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.