gooブログはじめました!

写真付きで日記や趣味を書くならgooブログ

Upload Image without refresh page

2013-04-15 08:36:35 | 日記

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, Blancpain Fifty Fathoms watch 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.

I suppose it is neccessary to bring a little bad news to Ajax at this point, it Fake Breitling Headwind Watch 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 file upload wiothout a compelete page 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 Jacob Co Epic I Watches will now use it to load the recently uploaded image into your web page dynamically and without a screen refresh. 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.