• Home
  • uToolbox Forum

µToolbox Blog - About Software Tools & Technologies

About Software Tools & Technologies

  • Articles
  • Republish Articles
  • Software Tools

Republish Article: Upload Image Without Refresh Page – Asynchronous Image File Upload Without Ajax

 Republish Articles  Add comments
May 292011
 

Upload Image Without Refresh Page – Asynchronous Image File Upload Without Ajax

Author: Asif Khalyani


Through concept such as Ajax and scripting languages like PHP, we now have a much robust set tools with which to deal with imaging. Thorugh Ajax, we can dynamically load and display images without the rest of the page having to reload, which speeds up the process considerably. We also have more control over what the user sees while the screen or images load. Users are generally understanding of load times, provided that you let them know what is happening. Thorugh Ajax and a little PHP magic, we can help the user's experience be a seamless and enjoyable as possible.

The basic uploading, manipulating and dynamically displaing images using PHP and Ajax.

Uploading Images
I suppose it is neccessary to bring a little bad news to Ajax at this point, it is not possible to process a file upload through the XMLHtrtpRequest Object. The reason of this is that javascript has no access to your computer's file system. While this is somewhat disappointing, there are still ways to perform Ajax-like functionality for this wighout making use of the XMLHttpRequest Object. Clever developeres have discovered that you can use hidden iframes to post a form request, thereby allowing for a image upload wiothout refresh.

I am designing a website with ajax and php. My main target is doing everything without full page refresh. I have done everything completed. I solved it partially using IFRAME.

By setting the iframe's CSS display property to none, the element is persent on the page to be utilized by the upload form, but not visible to the end user. by assiging a name to the iframe tag, you can use the target attribute in the form tag to post the request to the hidden iframe. Once you have the iframe configured, you can perform any uploads you like, and then use Ajax to perform any extra functionality. Consider the following example, which will allow yout to upload an image to a folder of your specification. Consider the code, which will allow you to create application.

An Ajax-enabled file upload system that uses hidden iframes to hide the upload

The code to create form, with a hidden iframe for processing

As you can see, you are using the same functionality and you will now use it to load the recently uploaded image into your

web page dynamically and without a screen refresh. The uploading function will still perform your form submission, but it is now coupled with a function called downloading, which will fire once the process_upload.php script has finished uploading the image (determined by the onload evernt). The doneuploading function takes ther parent frame of the hidden iframe and the fine name as arguments. It then users Ajax to dyanmically load the image the speicified element of ther parent frame.

Im trying to create a page for a picture framing site where users can upload images to see how they would look framed.

Uploading images can be broken down into the three following steps which will be looked at in turn:

* An HTML form with a browse button to allow the client to choose which file to upload
* A script to process the upload, validate the file, name it and place it in the file system
* Lastly a page to advise the client the upload was a success
* Is there a AJAX based solution or PHP based solution to check the filesize a user is trying to upload via a form.
* If the filesize exceeds more than 2 MB we want to give a message to the user that they need to upload a smaller file

size.

You can upload ZIP file of all your images in one shoot. You can upload image using zip file.
* You can create zip file for image, doc file and other file.
* This script find only jpg file uploaded and other file deleted.
* You can set which extension allowed or not allowed using this script uploaded.

Article Source: http://www.articlesbase.com/programming-articles/upload-image-without-refresh-page-asynchronous-image-file-upload-without-ajax-458806.html

About the Author

I am Asif Khalyani. I am software Engineer. PHP and ajax free script download site phpasks

  • Share this:
  • Share
  • Facebook
  • Email
  • Reddit
  • StumbleUpon
  • Digg
  • Print
 Posted by elton at 12:42 AM  Tagged with: ajax, asynchronous image file upload, download, free php script, js framework, login script, php, prototype js, submit form, upload image, without refresh upload image

 Leave a Reply Cancel reply

You must be logged in to post a comment.

  Republish Article: Advantages of Php Development   Republish Article: How to Recover/hack Msn, Windows Live, Hotmail Account Passwords

Follow µToolbox

Twitter Technorati Digg Facebook RSS




$1.99 Domains* at GoDaddy.com

Meta

  • Register
  • Log in
  • Entries RSS
  • Comments RSS

Recent Posts

  • Avail online McAfee AntiVirus support services to safeguard your computer with all online threats!
  • Overview of Security Issues in E-Commerce
  • Hack/Reset Windows XP, Vista, Windows 7 Administrator password
  • Minor Update to uToolbox WordCount Tool v1.0 Released!
  • uToolbox FileCopy Tool v1.0 Released!

Recent Comments

  • mcxprovider on SSL Certificates – Protect your customers and yourself
  • 1889 morgan silver dollar value on Republish Article: Ip Address Conflict: Easy Tip to Deal With It!
  • Thrustmaster Warthog on Republish Article: Ip Address Conflict: Easy Tip to Deal With It!
  • Addison Great Clips Coupons on Republish Article: Ip Address Conflict: Easy Tip to Deal With It!
  • Great Clips Coupon Print on Republish Article: Ip Address Conflict: Easy Tip to Deal With It!

Archives

Tags

adware bootable antivirus computer computer virus data database data portability gps time server internet internet security ip masker ip masking laptop malware mask ip mask ip address multiple search engines movies music web files share network time server ntp clock ntp gps time server ntp server ntp servers ntp time server pc repository reset windows password reviews security slow computer slow computer solutions soa software software development spam spyware sql stimulus preparation uToolbox Blog virus viruses website Welcome windows ntp server windows server 2008 windows vista

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

© 2012 µToolbox Suffusion theme by Sayontan Sinha
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.