Multiple animations with hover

I am trying to get an animation where the user hovers over one of 13 stars on string. What I am after is when they hover over one it looks like its been knocked and starts to swing for a shot amount of time. This should happen to them all. I have this code but it doesnt want to play!
Mouse Leave:
$(this.lookupSelector("star-1")).playReverse();
Mouse Enter:
$(this.lookupSelector("star-1")).play(0);
When you add more and more stars it just stops working. I can post up the edge file if that helps.
Thanks in advanced.

Hi there,
  It would be great if you could post a link to your project for the community to get a better look. : )
Thanks!

Similar Messages

  • How can I combine multiple animations. (Play another animation after one has finished with a click?)

    How can I combine multiple animations. (Play another animation after one has finished with a click?) Like a slideshow but with animations. any ideas?

    You can do this by calling up the different edge Animate composition html pages using buttons and an iframe:
    To get a general idea, put this in the body of an html page and insert your own URLs where indicated
    <iframe id="iframeID" src="yourFirstURL" width="640" height="480">
    <p>Your browser does not support iframes.</p>
    </iframe>
    <button onclick='loadIframe("iframeID", "firstAnimURL")'>First Animation</button>
    <button onclick='loadIframe("iframeID", "secondAnimURL")'>Second Animation</button>
    <button onclick='loadIframe("iframeID", "thirdAnimURL")'>Third Animation</button>
    <script>
    function loadIframe(iframeID,url) {
    //alert("Hello");
       document.getElementById("iframeID").src = url;
    </script>
    Peter Small

  • Multiple Animations for a single MovieClip sprite

    Ok, after hours of exhausting searching, and having to learn how to animate a simple sprite for the 100th time, I hope I might found I more specific, and better explained answer to my problem.
    I'm trying to make a flash game, of course, and I want my main Player sprite to be able to play multiple animations based on specific input. So, a running right animation, a running left animation, a jump animation, and an attack animation.
    At the moment, the most I can seem to achieve is to create a single timeline, with a default frame in the exact middle. Then when player holds left, it plays the previous frame, or scrolls backwards through the timeline. When the Right key is held, it plays forward from the default middle.
    It's ugly and extremely limited. I've tried using the gotoAndStop() and gotoAndPlay() methods, but because the statement checking for the key being pressed is constantly being checked, it will stay on the frame chosen for those methods, rather than move forward along the time line.
    I would greatly appreciate a better method for this, or a more specific tutorial to achieve the goal i'm looking for.
    I've seen mention of the attachMovie() method, but I can not find an understandable explanation of how to properly use it in the way I desire.
    essentially, the sprite will have the default standing frame while no keys are pressed. Then, if the right key is down, it plays the running right animation. When the left key is down, it plays the running left animation. When the jump key is pressed, it plays the jump animation. And when the attack key is pressed, it plays the attack animation.
    I hope that's enough information and that it's understandable, if not, let me know what more you need to know and I'll do my best to explain it more.

    You can do this a number of ways but I will try to explain the what I think is the easiest.
    Step 1
    Draw a box on the stage
    Step 2
    convert this into a movieclip (F8), name this myCharacter (or anything you want really), then press ok. Now select this movieClip and in the properties dialogue box, type "box", again, without the quotes. Then press enter.
    Step 3
    Double click this new movieClip (this should take you into this movieClip timeline)
    Step 4
    Now press F6, 3 times. This wil give you 3 additional key frames on this timeline. You should now have 4 key frames.
    |Step 5
    Select key frame 1 on this timeline and press F8. Type into the diag box "standing", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 6
    Step 12
    Make sure  your library is in view, if not Ctrl+L. You should see the movement clips you created, running_right, running_left, etc. Double Click any one of these and add the animation your want in these movs.
    There we go, simples.....Test you animation and see how you are doing.
    Select key frame 2 on this timeline and press F8. Type into the diag box "running_right", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 7
    Select key frame 3 on this timeline and press F8. Type into the diag box "running_left", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 8
    Select key frame 4 on this timeline and press F8. Type into the diag box "jumping", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Great, once you have done this, these new movieClips should now have appeared in your library (press Ctrl+L if you cannot see your library)
    Ok then you have just created your movement MovieClip. You now need to get back to the main timeline. You can just keep on clicking the stage to get back to this location. Once there you need to select the box you have just created and name this "box" for the time being.
    Ok then a little bit of programming now.
    Step 9Create a new layer in the timeline and name it scripts.
    Step 10Then select this layer and press F9 on your keyboard. THis should bring up the scripting pane for this frame.
    Step 11Type in the following code
    box.stop();// when you run this animation, this command will stop your box from doing anything
    var keyBoardListener:Object = new Object();// Creates a new Object for the keyboard presses
    keyBoardListener.onKeyDown = function() {
    if (Key.isDown(Key.LEFT)) {// runnning LEFT action
      _root.box.gotoAndStop(3);// Frame where the running right animation is
    } else if (Key.isDown(Key.RIGHT)) {// running RIGHT action
      _root.box.gotoAndStop(2);// Frame where the running right animation is
    } else if (Key.isDown(Key.UP)) {// JUMPING action
      _root.box.gotoAndStop(4);// Frame where the JUMPING animation is
    keyBoardListener.onKeyUp = function() {
    _root.box.gotoAndStop(1);// When the keys are released, this action takes your animation back to frame 1, where your character is just standing still.
    Key.addListener(keyBoardListener);// this assigns the listener to your key press detection Object.
    Step 12
    Edit the action movs within your library by double clicking each one and adding movement to each. Then test your animation.

  • How do i create an animation with one frame for each layer?

    I have 76 sequential images that i've loaded as layers using bridge, then aligned using photoshop.
    I would now like to create a 76 frame animation with one animation frame for each layer
    (the layers are in sequential order).
    is there an easy way to do this
    or do i have to create 76 frames (can duplicate multiple to speed it up)
    then set layer visibility for each frame?
    thanks
    bill w
    astro.whwiii.net

    thanks for all the replies
    got it
    here's a rough draft of 2 hours of sunshine
    http://whwastro.homestead.com/files/big/31-05-2014-prom-animation.gif
    -bill w
    astro.whwiii.net

  • Multiple Animations in a PDF

    I have followed a tutorial on animations in .pdfs made by
    Right Hemisphere and have got things working....
    ...however, the tutorial plays back ALL of the animations in the u3d at
    once. I have created a u3d file with Deep Creator which has mutiple
    animations. By multiple, I mean that one object has its own animation,
    and another object has its own animation. The code provided in the
    tutorial plays both of these animations at the same time. I want
    to tie a button to play only one of the animations, and another button
    to play the other animation.
    Is this even possible???
    I've been searching the internet and the Acrobat 3D API but have not
    found any help.
    BTW: I am only using Acrobat 8.0 Pro for this project
    Thanks in advance for any assistance with this.

    First of all... the first result I get on Google when I search for "acrobat 3D api documentation" is the acrobat 3D API for version 8
    http://www.adobe.com/devnet/acrobat/pdfs/js_3d_api_reference.pdf
    Second... this is a better way to do it with multiple animations
    //====================
    function AnimationObject(animationIndex)
    this.Anim = scene.animations.getByIndex(animationIndex);
    this.timer = new TimeEventHandler();
    this.timer.active = false;
    this.timer.onEvent = function(event)
    if (this.timer.active)
    this.Anim.owner.currentTime += event.deltaTime;
    if (this.Anim.owner.currentTime > this.Anim.owner.endTime )
    this.Anim.owner.currentTime = this.Anim.owner.startTime;
    runtime.addEventHandler(this.timer);
    this.start = function()
    this.timer.active = true;
    this.stop = function()
    this.timer.active = false;
    var anim1 = new AnimationObject(0);
    var anim2 = new AnimationObject(1);
    var keh = new KeyEventHandler();
    keh.onEvent = function(event)
    if (event.characterCode == 32) //Spacebar
    anim1.timer.active = !anim1.timer.active;
    else if (event.characterCode == 99) //lower case 'c'
    anim2.timer.active = !anim2.timer.active;
    runtime.addEventHandler(this.keh);
    //=======================

  • After installing 2014.3 my site had multiple issues with Google Chrome

    After installing 2014.3 my site had multiple issues with Google Chrome. After I rebuilt the home page in 2014.3 the site is still not well. With the old software the site worked well with all the browsers and loaded incredibly. Despite Adobe's claim of a faster load with the new software it is much slower and in Chrome at times it won't load up at all.
    The home page had two "Video-Animation light box galleries" by Visual pictures company. One had 12 videos, the other 3 videos. All the videos were streamed from Vimeo. There was also an Edge Animate animation in the middle of the page imported as a .oam file. the rest of the page was nothing special except using some web fonts. Again, these elements worked together well before the update.
    After the update everything loads slower in all browsers and in Chrome all types of weirdness happened. Videos would play randomly, all of the audio from all the videos played as the site loaded. Videos would play in the wrong place. Instead of my animation playing a video from the galleries played in it's place instead.
    I rebuilt most of the home page using a new video gallery and that helped some what but when I placed the animation.oam file in the page had new issues. To survive, I've taken the Animation out which helped but the functionality is still far from being acceptable. My boss is un my backside, other work is not getting done the stress level is through the roof because I was the one who encouraged using all these new Adobe tools (which I'm paying for personally). Now you broke it with a new update. This is not the first time I've been caught out with problems with updates. I couldn't use SpeedGrade for months following an update. ADOBE MUST VET THEIR       

    Sorry,
    It was slated to go to the Creative Cloud - Muse area. How it got to Photoshop is beyond me.
    Bob

  • The Best Tool For Multiple Animated Objects

    Hi,
    I am expirimenting with Flash Web Sites, and I would like suggestions as to a starting point for my project, and I am assuming a Flash website is where I would start.
    Basically, If I were to open up a web page, I would like to see multiple animated objects.  For example, if I were to simulate an Emergency Room, I would have an EKG displaying a heart rate, then perhaps see a breathing maching apparatus moving up and down, a Drip bag (sorry, don't know the real term), dripping into a patient's tube.  And of course, if I were to roll over an object it would animate, and if clicked on more animation or on to another page.
    I tried creating the animated objects in Fireworks, and I thought I could combine various Firworks files into one, but it didn't work (too many frames), either becasue I lack the knowlege of how to do this or simply it cannot be done that way in Fireworks.  I had a background with one animated flashing object (that was easy), but combining multiple independent objects, I could not figure it out.
    Someone suggested that I would have to use Action Scripts, which made me realize, I don't know the best way to accomplish my example above, and although I know I may be over my head, I would just like to get direction as to where I should begin.
    Should it all be in Flash in the first place?  To continue on with the example above, after a user clicks on the rollover image, a girney comes rolling in and we are giving choices on a monitor with what our next actions should be, which would take us into another page.  (this is just to give you perpective of what I am trying to accomplish).
    Should I create independent animated objects (files) in Fireworks, then somehow import them into their specified location in Flash.
    I hope this makes sense and I am hoping someone is kind enough to provide a starting point.
    Best.

    Flash is the best tool for what you want and most of it can be done once you get a handle on the basics.
    For you interactivity (rollOvers / triggering more animations with mouse) you will need some actionscript but don't get hung up on that now.
    There is a world of info out there. Google "animation basics in flash) you may have to weed through some garbage but you will find what you are looking for somewhere.

  • Multiple animations for Responsie page

    Hi
    I am building a website with responsive webdesign in Dreamweaver. For the mobile I want a different animation the tablets/desktops hoe can I do this?
    Beceau with the normal responsiveness in Edge the mobile I can;t get the placements good So I want to make two different animations on optimized for mobile (480px width)  and the other for tablet/desktop (640 to 960).
    this is the website I am working on: 55k-producties.businesscatalyst.com
    Regards,
    F. Knijn

    goatmud wrote:
    > what about creating multiple animations one the same
    page in FW? In IR each
    > rollover has it's own animation timeline so you can make
    as many animated
    > rollovers as you want, but in fireworks there is just
    one frame timeline. I
    > tried getting around this by putting a animation symbol
    in the over state on a
    > button but it won't let me. Don't tell me i have to
    create individual
    > animations and place them in dreamweaver!
    >
    At this point, I recommend you post the PNG file so some of
    us can take
    a look at it.
    Jim Babbage - .:Community MX:. & .:Adobe Community
    Expert:.
    http://www.communityMX.com/
    CommunityMX - Free Resources:
    http://www.communitymx.com/free.cfm
    .:Adobe Community Expert for Fireworks:.
    Adobe Community Expert
    http://tinyurl.com/2a7dyp
    See my work on Flickr
    http://www.flickr.com/photos/jim_babbage/

  • Is it really true that EA CC 2014 does NOT support multiple animations on a single page?

    My page has multiple animations that I have spent days designing, and now my developer is telling me we can only use one. 
    Is this seriously true?  A lack of detail on this issue will surely drive me to use another product like Hype or Google...
    http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html#multiplecompositions

    Hi,
    Please check this article, you can still use multiple composition on a single page, it is working on Edge CC214
    Nesting Animate compositions with the Composition Loader by Edge Commons | EdgeDocks.com
    I will check more on this with the concern team and let you know.
    Regards,
    Devendra

  • How do I use edge commons composition loader to load multiple compositions with a next and back button?

    I am working on an interactive book and have set up each page as a separate composition in edge.
    I am using  the edge commons JS library to load multiple compositions into a main composition.
    You can see how this works here: Edge Commons - Extension Library for Edge Animate and Edge Reflow | EdgeDocks.com
    The way the edge commons tutorial is set up requires a button for each composition i want to load. I am interested in loading multiple compositions with a "next" and "back" button, and a "swipe left, "swipe right" gesture on the content symbol that each composition is loaded into. I also need the swipe features on the content symbol not to interfere with the interactive elements on the loaded composition.
    Please suggest a solution that will work without adding additional scripts beyond edge commons and jquery.

    Sort of. I'm using this code inside an action for a button symbol. But it doesn't work perfectly. Trying to debug it.
    Let me know if you have any luck.
    //Check to see if pageCounter already exists
    if (typeof EC.pageCounter === 'undefined') {
      // it doesn't exist so initialize it to first page
        EC.pageCounter = 2;
    //check if the page is only 1 digit -- patch for single digit
    if (EC.pageCounter < 9) {
       // it is, so we need to pad a 0 on the front.
      EC.pageCounterString = "0" + EC.pageCounter;
      //e.g.  01 ...09,11,12,13....115,222352,,....
    else {
      EC.pageCounterString = EC.pageCounter;
    EC.loadComposition(EC.pageCounterString + "/publish/web/" + EC.pageCounterString + ".html", sym.$("container"));
    EC.pageCounter = EC.pageCounter + 1;
    //TODO for back  -1

  • There are multiple users with the same display name

    Hi,
    We have a user and when she get an item assigned to her she sees the following alert:
    "There are multiple users with the same display name USERNAME and at least one of them does not have read permissions to some of the files"
    Now I looked in the database and when I run the following query with the username:
     SELECT     
         [ProviderDisplayName]  
        ,[DisplayName]  
        ,[HasDisplayName]  
        ,[Domain]  
        ,[AccountName]  
        ,[UniqueUserId]  
        ,[LastSync]  
      FROM [Tfs_Configuration].[dbo].[tbl_Identity] where displayname like '%USERNAME%'  
    Then I get 2 same usernames back, How can I get rid of one of them ? When I access TFS trough the portal I only find 1 occurence of this user.
    We use VS2013 and TFS2013 update 4
    Best regards

    Hi DSW,  
    Thanks for your post.
    In your query result, please check if these two users have the same Account Name. if they are two different Account Name in result, it indicate there’s two users have the same display name in your AD, please check that two users’ information in
    your AD. We suggest change one user’s display name in AD.  
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using multiple desktops with a 4 finger swipe on a Mac Book Pro running Lion- is there a way that I can allow Safari open on several but not all??  Looks like I can set it for one but not others.  All, one, or nothing

    Using multiple desktops with a 4 finger swipe on a Mac Book Pro running Lion- is there a way that I can allow Safari open on several but not all??  Looks like I can set it for one but not others.  All, one, or nothing

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • Bridge CS4 won't output to pdf multiple images with same filename

    Hiya...my googling efforts have thus far failed!
    I've got CS4, and in Bridge, I created a New Smart Collection to find all filenames in a folder containing "." or ".jpg" - which in turn searched through all the subfolders like what you used to be able to do in Photoshop CS3.  Very simple stuff, but all the images are jpg's, but in multiple folders (I don't want to move them out of the folders, as the files came from an external source, and there are heaps of folders, and I don't want to pdf each subfolder seperately as it will take forever).
    The problem is that some of the files have the same filenames (again I'd prefer not to rename, as it happens a lot on this project, and they are all over the place).  So whilst Bridge will show the thumbnail images correctly in the content tabbed screen in my New Smart Collection, but once I've done the Output to PDF thing, for example, instead of showing both different images it has pdf only the first image but repeated it twice.  And this happens multiple times throughout the pdf, the more times the same filename is used, the more times the first image gets repeated.
    I know that it is messy to have multiple similar filenames, but why can't bridge just place the image anyway?  It allocated a space for it on the pdf and does show it in bridge, it just doesn't seem to survive the transfer to pdf well.
    The only other thing that I have done is use the below link (which was posted on another adobe forum thread) to create a custom pdf output template (nothing too fancy, just number of rows / columns, size, font etc).  But I've tried using the standard bridge templates and it does the same thing.
    http://www.proficiografik.com/2009/08/03/save-custom-pdf-output-template-in-adobe-bridge-c s4.html
    Any help would be appreciated...even if to tell me that I am being unreasonable!
    UPDATE 16/11/09
    Just to let you know that I seem to have resolved the bug inadvertently with one of the Adobe updates. The below is the link for the AdobeOutputModule-2.1-mul-AdobeUpdate.zip which was released on 2/19/2009 - which allows for headers & footers to be placed in the Ouput pdf. I finally installed it today, and everything seems to be working fine now (i.e. I can pdf multiple images with the same filenames and the pdf will actually show each different image rather than repeating only 1 of the images).
    Must have been a fix installed in the contact sheet templates that get installed with the update - not sure why the original version was corrupted, but I've left that with the Adobe guys (I submitted a bug report - and they were able to replicate the problem but hadn't fixed it as yet).
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=4228
    Message was edited by: djtun71 (16/11/09)

    When I click import from disc I am asked to choose a disc and then I get this message:
    The following photos will not be imported because they are already present in the catalog. To see these photos in the catalog select 'Show in Library' (the import will be canceled).
    This is followed by a long list of images. If I click 'Show in Library' I can see all the images with the same filename. And then they start to automatically write over those images with images from the disc. However they keep the same metadata and keywords from the previous images. If I click on Import and deselect the "don't reimport suspected duplicates" box, it imports only the images that don't share filenames and none of the images that do.
    Is there a way of setting the "Don't reimport suspected duplicates" box in preferences?

  • Multiple Issues with Adobe Creative Cloud app.

    I'm having multiple issues with the Adobe Creative Cloud app.
    1. Neither Photoshop CC nor Prelude CC get past the 47% mark when installing. They constantly give me "Installation Failed" messages. When I click on "Learn More", I'm told that:
    "Installation Failed
    Errors during Installation.(7)
    More Information"
    So naturally, I click on More Information to get the following thrown at me (none of which I understand):
    Exit Code: 7 Please see specific errors below for troubleshooting. For example,  ERROR:   -------------------------------------- Summary --------------------------------------  - 0 fatal error(s), 2 error(s)    ERROR: 12/01/13 13:16:06:425 | [INFO] |  | OOBE | DE |  |  |  | 6076 | ---------- CustomHook_Helperx64 ---- Start ----------  12/01/13 13:16:06:426 | [ERROR] |  | OOBE | DE |  |  |  | 6076 | Cannot load function name 'CSInstallerCustomHookProc' from library C:\Program Files (x86)\Common Files\Adobe\Installers\uninstall\{5F816B76-62F3-41C9-B651-27F49F25F50B}.data. Error 0    ERROR: System check returned with error : -4  -------------------------------------------------------------------------------------
    2. I installed Lightroom 5, then uninstalled it. When I went back to re-install it, the Adobe Creative Cloud app wouldn't let me. It states that my Lightroom 5 is "Up to date" and is in my "Your Apps" section, not in the "Find New Apps" section. I've double checked my Programs and Features in Control Panel, and it's not there. I cleaned my registry, and it's still there. I deleted the "opm.db" file in my OOBE folder, and restarted CC - still nothing.
    I've got to say, guys. I'm not very happy with the amount of time I've spent just trying to install programs on my PC. While the plan is for this to be intuitive at some point, it's not very functional at the moment. Any help you can provide me would be amazing - if you can provide it sooner than later, I'd be over the moon.
    Thanks.

    I fixed it. I fixed it on my own. My journey took over a week (forty hours of back and forths, trial and error, and service!!) and included multiple calls, multiple online chats, unanswered forum posts, Twitter conversations with the Adobe Customer Service team, remote access sessions with Adobe technical teams, and finally this series of emails. In the end, I had to figure it out myself. I'm not happy - not with the time it took, and not with the level service I received based on the urgency that I made clear.
    For anyone else that had this issue (or similar), here is what I did to fix it. This may seem excessive, but that's because I didn't know what else to do. Some of these steps may be redundant, or not required... but I wouldn't know because once I saw that it was working, I just kept going.
    Anyway, here is the solution I came upon (I'm running Windows 7 64-bit):
    1) I uninstalled every single Adobe product (including Flash Player, Acrobat Player, Air, and Digital Editions).
    2) I ran the Cleaner Tool (which is not very good) and came across errors in trying to delete certain folders.
    3) I restarted my computer in Safe Mode, and logged into Windows 7 under my Administrator account.
    4) I manually went into every folder that contained the words "Adobe" and deleted everything. This includes my Program Data folder, my Program Files folders (both x86 and 64-bit), my AppData folders, my Roaming folders, my Temp folders - ANYTHING and EVERYTHING that contained any trace of Adobe, I deleted.
    5) I ran Microsoft Disk Cleanup and Piriform CCleaner to clean my registry and temp files.
    6) I restarted my computer using the normal boot process and logged into Windows as Administrator.
    7) I downloaded the Adobe Creative Cloud installer.
    8) I restarted my computer again, and logged into Windows as Administrator.
    9) I ran the Creative Cloud installer, and installed Premiere Pro.
    10) I restarted my computer again, and logged into Windows as Administrator.
    11) I ran the Creative Cloud installer, and installed Photoshop.
    12) I restarted my computer again, and logged into Windows as Administrator.
    13, 14, 15...) I ran the Creative Cloud installer and installed whatever programs I needed, then I IMMEDIATELY restarted my computer before installing anything else.
    Hope this helps. Good luck!

  • Upload multiple files WITH correct pairs of form fields into Database

    In my form page, I would like to allow 3 files upload and 3 corresponding text fields, so that the filename and text description can be saved in database table in correct pair. Like this:
    INSERT INTO table1 (filename,desc) VALUES('photo1.jpg','happy day');
    INSERT INTO table1 (filename,desc) VALUES('photo2.jpg','fire camp');
    INSERT INTO table1 (filename,desc) VALUES('photo3.jpg','christmas night');
    However, using the commons fileupload, http://commons.apache.org/fileupload/, I don't know how to reconstruct my codes so that I can acheieve this result.
    if(item.isFormField()){
    }else{
    }I seems to be restricted from this structure.
    The jsp form page
    <input type="text" name="description1" value="" />
    <input type="file" name="sourcefile" value="" />
    <input type="text" name="description2" value="" />
    <input type="file" name="sourcefile" value="" />The Servlet file
    package Upload;
    import sql.*;
    import user.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Date;
    import java.util.List;
    import java.util.Iterator;
    import java.io.File;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.text.SimpleDateFormat;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.*;
    public class UploadFile extends HttpServlet {
    private String fs;
    private String category = null;
    private String realpath = null;
    public String imagepath = null;
    public PrintWriter out;
    private Map<String, String> formfield = new HashMap<String, String>();
      //Initialize global variables
      public void init(ServletConfig config, ServletContext context) throws ServletException {
        super.init(config);
      //Process the HTTP Post request
      public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        Thumbnail thumb = new Thumbnail();
        fs = System.getProperty("file.separator");
        this.SetImagePath();
         boolean isMultipart = ServletFileUpload.isMultipartContent(request);
         if(!isMultipart){
          out.print("not multiple part.");
         }else{
             FileItemFactory factory = new DiskFileItemFactory();
             ServletFileUpload upload = new ServletFileUpload(factory);
             List items = null;
             try{
                items = upload.parseRequest(request);
             } catch (FileUploadException e) {
                e.printStackTrace();
             Iterator itr = items.iterator();
             while (itr.hasNext()) {
               FileItem item = (FileItem) itr.next();
               if(item.isFormField()){
                  String formvalue = new String(item.getString().getBytes("ISO-8859-1"), "utf-8");
                  formfield.put(item.getFieldName(),formvalue);
                  out.println("Normal Form Field, ParaName:" + item.getFieldName() + ", ParaValue: " + formvalue + "<br/>");
               }else{
                 String itemName = item.getName();
                 String filename = GetTodayDate() + "-" + itemName;
                 try{
                   new File(this.imagepath + formfield.get("category")).mkdirs();
                   new File(this.imagepath + formfield.get("category")+fs+"thumbnails").mkdirs();
                   //Save the file to the destination path
                   File savedFile = new File(this.imagepath + formfield.get("category") + fs + filename);
                   item.write(savedFile);
                   thumb.Process(this.imagepath + formfield.get("category") +fs+ filename,this.imagepath + formfield.get("category") +fs+ "thumbnails" +fs+ filename, 25, 100);
                   DBConnection db = new DBConnection();
                   String sql = "SELECT id from category where name = '"+formfield.get("category")+"'";
                   db.SelectQuery(sql);
                    while(db.rs.next()){
                      int cat_id = db.rs.getInt("id");
                      sql = "INSERT INTO file (cat_id,filename,description) VALUES ("+cat_id+",'"+filename+"','"+formfield.get("description")+"')";
                      out.println(sql);
                      db.RunQuery(sql);
                 } catch (Exception e){
                    e.printStackTrace();
            HttpSession session = request.getSession();
            UserData k = (UserData)session.getAttribute("userdata");
            k.setMessage("File Upload successfully");
            response.sendRedirect("./Upload.jsp");
      //Get today date, it is a test, actually the current date can be retrieved from SQL
      public String GetTodayDate(){
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
        String today = format.format(new Date());
        return today;
      //Set the current RealPath which the file calls for this file
      public void SetRealPath(){
        this.realpath = getServletConfig().getServletContext().getRealPath("/");
      public void SetImagePath(){
        this.SetRealPath();
        this.imagepath = this.realpath + "images" +fs;
    }Can anyone give me some code suggestion? Thx.

    When one hits the submit button - I then get a 404 page error.What is the apaches(?) error log saying? Mostly you get very useful information when looking into the error log!
    In any case you may look at how you are Uploading Multiple Files with mod_plsql.

Maybe you are looking for

  • Analog to digital video converter for DVD

    I have a DVD burner that came with my G5. I have a lot of VHS analog tapes that I would like to digitize and turn into DVDs. Can anyone recommend an inexpensive product(s) that will allow me to do that? Thank you. Power Mac 2.5GHz Dual   Mac OS X (10

  • Java returns wrong DynamicIP

    I hava a dynamic IP address and the host: "somehost.ip.net" returns my dynamic IP. If I check it with nslookup or ping, I always see my actual IP. I have run this code: try {                            InetAddress addr = InetAddress.getByName("someho

  • Calendar publishing host does not update automatically

    GroupWise 2014 is installed on OES11 SP2 with web access and calendar publishing host in virtual vmware environment. The calendar will not automatically update existing or display newly published users' calendars until I manually enter rcnovell-tomca

  • Is the US Labview Student 7.1.1 edition available in the UK?

    The "student version" of labview in the UK at the moment appears to be Labview 7.0 express, but I need to use the vision development suite, which is not included with this. The US site advertises Labview 7.1.1 which incorporates a lot of the developm

  • Capture user comments when unpublishing a document

    Hi, I have a requirement to force the users to enter comments when Unpublishing a document. I have looked around various web sites etc and cant seem to find how to achieve this either by an OOB feature or by developing some form of event receiver. Do