upload image in new window and postback filename to form

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Aug 03, 2010 1:02 am

upload image in new window and postback filename to form

Postby andycheshire » Tue Aug 03, 2010 1:26 am


I'm very, very new to PHP.

At the moment I use ASP to script my websites and use MySQL as the backend database. The problem I'm having is that ASP (because of various reasons) is limiting the file size of the image I can upload - because of that I want to use PHP to upload a resize my images and save the filename(s) to my MySQL database.

However I want to use just one form for my users to create a record (in this case a new product) and because of time restraints and other on-page scripts I need to keep the main form as an ASP page (this is the form that actually gets submitted to the MySQL database).

Therefore what I want to try and achieve is to have my usual ASP page (form) for all he usual form fields - then I want a link/button, which, when the user clicks it, opens in a new popup window which contains just the PHP Upload file/image field and script - the user selects their file and uploads the image, the PHP script uploads the image to a directory and creates a smaller thumbnail version and then posts the two filenames back to hidden form fields on the main ASP form page and then closes the popup window.

I can then create the new record (with the hidden filenames) using the ASP form and MySQL (as I currently do).

Is this possible? and if so can anyone point in the direction of either a good tutorial or a script that can upload an image, resize it and then post the filenames back to another form.

Many thanks.

New php-forum User
New php-forum User
Posts: 3
Joined: Tue Aug 03, 2010 2:07 am
Location: Bangalore

Re: upload image in new window and postback filename to form

Postby shridhar » Tue Aug 03, 2010 4:52 am

Hi andycheshire,

Correct me if I am wrong, or ignore this if it is not relevant to your prob.
My suggestion for your approach is, there are lots of javascript library available in internet namely, jQuery plugins to upload images.
So instead of creating php file only for image upload and postbacking values to ur asp page, its will be good if u use jQuery plugins in ur ASP main page to upload images so that u ll have control hold on it.

Thanks and regards,
Shridhar Govindaiah,
Samartha InfoSolutions Pvt Ltd (http://www.samarthainfo.com)

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest