image upload with Ajax and without Submit button in Codeigniter - php

I'm using Codeigniter. I need to upload Avatar image for my site. I need to upload image with Ajax and Jquery. But NO need Submit button. When I click upload->open it's directly goes to upload via ajax/jquery.
Here after only im going to start my code. If you want sample code, use this link.
Note: (looks & functions) It's should same for all browser.
and I don't want any uploader package.
Thanks...

Related

jquery preview modified image in dialog

I have a form with 2 file input which the user will select images to upload.
On submit when the images are uploaded, I first resize the image and merge it with another image using gd and this works fine.
What I want to do before the form is submitted, using Ajax on change of the file input, get the image, processes it on the server using gd (but not upload) and show the user the final result in a ui dialog for them to approve or not.
For reasons beyond my control I cannot use html5. I know you can't post files using Ajax and need to use jquery-iframe-transport or jquery-file-upload or some other plug-in like that.
What is recommended and how do I return the final image to display in the dialog, and if the user then click disapprove, how do I clear the file input field?
Thanks
Take a look at this: http://www.9lessons.info/2011/08/ajax-image-upload-without-refreshing.html
The above tutorial will show you how to do image upload using JQuery.
You can easily change the php file that handles the upload, show the image to the user, if they clicked disapprove, then simply remove the file from the server and start over.

how do i use selenium to test javascript image upload?

I am using jquery MultiFile js to do an image upload function in an admin page.
I am implementing Selenium right now within phpunit.
I would like a detailed description of how to test the following scenario using Selenium:
1) access to /admin/products/new
2) fill in title textbox
3) click on upload image button
4) upload 2 images
5) hit overall submit button
6) redirect to /admin/products and check for success message
I am able to write assertElementPresent etc commands for steps 1-6 except 3 and 4.
Please advise.
If I understand correctly, you're asking how to upload an image using Selenium. The default way of uploading images would be to use the typeKeys() method to pass the file name to the input file uploader.
Use Selenium to log in as an admin and browse to the /admin/products/new page.
If you're using RC, use typeKeys() to fill in the title textbox. If you're using WebDriver, use keys().
Upload an image by targeting it and sending the file name with typeKeys() or keys().
Refer to step 3.
Use Selenium to click the submit button.
waitForElementPresent on success message.

Upload a file using PHP and Jquery without displaying the browse window?

I want to upload a file using PHP and Jquery.I know the path where it is saved(Path is static with the same file name).Every time when the user click the upload button then I need to upload the file in the backend and displaying only the uploading gif image in the front end.So is it possible to make the upload without displaying the browse window using Jquery and PHP?
for that u can use jQuery Uploadify: http://www.uploadify.com/demo/

Take picture from local video source and submit via PHP form

How would I go about taking a picture from a video capture card or webcam? Should I use flash to do this? I want to submit the picture via a php form and upload it to my webserver and place a link to it in my MySQL database. Is there a flash app already built that I can use to perform this?
try this:
http://code.google.com/p/jpegcam/

Upload an image using class.upload.php via AJAX, display image in form using jQuery

I am using class.upload.php to handle an image upload from a form that submits employee details to a MySQL database. class.upload.php does EXACTLY what I want it to do, resize the image and rename it - what I am now trying to accomplish is to upload via Ajax after the user selects the file and then display it in the form while they continue entering details. How would this best be accomplished with jQuery?
I have used Uploadify to serve this purpose on several websites. It works quite well once you get the hang of it.

Categories