copy and paste images within a php driven application

Posted on 2005-05-13
Last Modified: 2010-08-05

I need advices to improve the user side performaces of a php driven web application developped with php 4.x/Apache/Oracle/Linux. App is used in 100MB LAN

Here is the current scenario.

* Clients are powerful Windows XP boxes with IE6x
* We re inserting jpg images to the app database by attaching pjg files.
* images are coming from a graphic design application. in order to attach a file users has to:
    . copy the image are within the graph app.
    . paste the image to the new document within  the same graphic app.
    . resize the image to lower resolution
    . save as jpg.
    . go to the above said application find and attach the jpg file
    . and submit
* The whole process takes 3 to 4 mins for a trained user.

User are repeating these operations very ofthen, it s time taking and stressing.

What would be the best solution we can implement within the application on server to ease the life of the users.

As fas as my knowledge goes we can copy images and paste to java applet.

What I d need is ;
 . copy the image to an area within the web app in IE6.
 . the solution would rescale the image to a given resolution before parsing data
 . and user clicks submit.

This is what comes to my mind as a non-coder.

Would the applet start fast enough within IE so that users can paste within an area the copied image ??

Can you please give me some indications about the best solution I can ask the developpers to code. ?

I know there are even open source applets that might fit to purpose if java applet is the best solution. Can you give me some indication to the locations please ?

I m giving the maximum possible points . Sorry if this is not the right place for this question.

Question by:tgunduz
    LVL 5

    Expert Comment

    Your users can just store the images on a location in the LAN. You can then change your PHP web application to automatically resize the image before it is submitted. There is a free plugin software that allows images to be resized. Go to

    Author Comment


    yes I have slight knowledge of this open source tool.  I m afraid it does not solve my copy and paste problem

    user still has to save as *.imagefiletype then go to the php app to upload.

    I need to be able to copy and paste directly to the my web application

    any idea ?
    LVL 5

    Expert Comment

    What does your php application do? Does it store the image information into a database. I need to understand what your php app does in order to provide you with the best solution.

    Author Comment

    pls read once again ...mabe for me it is clear :)

    basically ;
    its a ERP like app ..we need to store our item's pics agains their specs. the picture should be stored while the items data is being manipulating the images in in the CAD/CAM design app in order to save as jpg then use in the said app is really time taking...source images are coming from desktop CAD/CAM app and destination is php driven web app...

    I was thinking that a copy and paste would be the fastest solution ...but how ?

    LVL 30

    Expert Comment

    I think you don't get a lot of responses because what you are trying to do is not very clear.

    From what i understand, you have a picture in some poprietary format.
    And your ERP needs the resized image in the jpg format.

    Resizing jpg files can be automated using various programs, but converting the proprietary image to a jpg or other standard format is the problem.

    Using copy/paste will probably not help.
    When you copy inside an app, the content is copied to the clipboard.
    Then, when you paste to another app, it's the content of the clipboard that gets pasted.
    So, the copy/paste between the 2 apps will only work if the 2 apps support the same clipboard content.
    I doubt your proprietary app will place any standard format image into the clipboard when you do a copy.
    LVL 5

    Expert Comment

    You might consider creating a batch program that reads from directory of images and adds them to your backend system.
    We can discuss this in further detail if you are willing to consider this route.

    Author Comment

    thank you all

    basically I was expecting to be able to paste images to a java applet within a php driven web app . the most important point is the possibility to past images to this applet. resizing the images and transforming to jpg format is - I think - easier


    Author Comment

    additional info:

    I can past images copied from the CAD/CAM to MSPaint . this functions.
    LVL 45

    Expert Comment

    Sounds like you are looking for an application into which user can copy paste the image. The application will
    - resize it
    - store it as a jpg
    - upload it

    Am I right or is there something else too? If yes, then how does the application know upload location? Is it possible to know/derive it?
    There are plenty of free application which can
    - resize and convert images and support shell functionality. Your application can invoke it to do the image related processing
    - yet another application can be invoked for upload part
    If this is possible, you will save substantial development, testing and maintenance effort.

    >Would the applet start fast enough within IE so that users can paste within an area the copied image ??
    It would take a short while the first time but once JRE is loaded, it should be faster. You say that the machines are high power XP boxes, so I do not think speed will be a big issue for a Java based solution

    Author Comment

    > Sounds like you are looking for an application into which user can copy paste the image. The application will
    >- resize it
    >- store it as a jpg
    >- upload it

    > Am I right or is there something else too?

    That's correct. The web application is php driven with oracle database. We are actually uploading our images to the database trough the web page. User selects the jpg file he has just manipulated (copied, pasted, resized, saved as..) and validated. The web application uploads and stores to oracle Database.

    I m trying to find a solution to save the users time on the  manipulation process (copied, pasted, resized, saved as..). Ideally we shud be able to copy a selected image area from CAD/CAM application to the a webpage with say a java applet can accept image paste operation.

    Copy from CAD/CAM application and paste to MSPaint functions.

    LVL 30

    Expert Comment

    You might be able to do what you want with a java applet.
    The applet can:
    1.  read the content of the clipboard (binary data).
    2.  mime-encode the bytes using the correct mime-type (you'll need use trial/error here).
    3.  call a javascript method that writes the mime-encoded image to a hidden form field (make sure your hidden field has the same "name" as the initial <input type="file">).

    That's the basic idea, but i'm not sure it will work.
    I don't know exactly how the file attachments are posted and if it's equivalent to using an hidden field that contains the mime-encoded data.
    LVL 10

    Expert Comment

    GrandSchtroumpf has provided a very good approach. But, I am not too confident about the clipboard reading for least not through JavaScript (javascript allows text & url...but image..I have doubts). Trial-n-error...sure.

    LVL 30

    Accepted Solution

    > But, I am not too confident about the clipboard reading for least not through JavaScript (javascript allows text & url...but image..I have doubts).
    Well, that's the whole idea behind using a java applet, and not javascript.
    But once you have your image in the applet, the problem is to send it with the rest of the data.

    You can try submitting the data from your applet (http request from java).
    From the applet, you can access the content of your form fields and send all the information you need, including session id or hidden field values.
    You can even use the applet to collect the complete user input (image + description).

    Note that an applet can call a javascript method and javascript can call an applet's method.
    So, with both java and javascript, you should be able to find a way to make it work.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
    Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now