Upload an image in jquery mobile - php

I was required to develop a mobile application of the existing system, and I have recently learnt about Jquery Mobile, and I was fascinated that I can use php with Jquery Mobile which will make my task more simple. My recent problem is with the uploading the image from the mobile devices memory. Is it possible to upload images and store it in a BLOB field in a database table? If so is done the 'normal' php way or is there another way of doing it in Jquery Mobile.
Thank you

If you want to use file uploads with jQuery Mobile you have to do two
things:
1) Turn off Ajax navigation using data-ajax="false" on your
form definition because you can't upload files using Ajax.
2) Specify
the appropriate encoding type of enctype="multipart/form-data" on your
form.

Do just normal way of file uploading in HTML. Follow for example http://www.w3schools.com/php/php_file_upload.asp

Related

HTML/PHP/JS - Upload File while filling Form

i have a form with a Photo Upload Input. I want the picture to be uploaded before submitting the form to speed up the submit.
the form should be able to upload multiple files and should show a progressbar + preview.
how i can do this?
MetinKale38
You can do this pretty easily now in HTML5 using XMLHttpRequest with a multipart form and the file element. XMLHttpRequest now supports progress events which you can handle in your Javascript code. Here is a link to an excellent article with detail and code examples http://www.matlus.com/html5-file-upload-with-progress.
Note that your PHP code must still treat each file independently, but that is transparent to your JavaScript - it will simply make multiple posts to the server.

Difference between Ajax upload and Normal upload

i have a doubt with the upload system in PHP.
What is the difference between Normal Upload [ without ajax ] and Ajax Upload ?
By using Javascript i can send values to the server ,is it possible in the case of Files ?
Is there any limitation for this ? and i found that so many uploaders are using FLASH for to upload FILES,
ex:Gmail,uploadify.....
How can i build a basic uploader with JQUERY/javascript ? also i heard that i cant send FILE by a XHR request.
i am using Codeigniter Framework.
Expecting Possible duplicate or other refference
Main Goal Of this Question is to build my own uploader for my current project[neat and clean]
Okay, AJAX upload is basically just that, it's going through Javascript. The difference is that the page does not upload, and you can carry on with other things as it works. It generally makes for a better user experience in my opinion, it feels more seamless
On the other hand, it only works for newer browsers. Firefox, Chrome, Opera have it, but not IE (maybe Safari?). It also works well with drag and drop. I once made an image uploader inside a text editor, where it popped up a table with your currently uploaded images, you clicked one and it added it to the textbox or you dragged a new image into a box and it uploaded and displayed it straight away. It was beautiful.
Here's the plugin I used to help me
http://dropup.net/
Edit: No limitations either, you can even send plain binary data in
well as if you want to upload the file with jquery ajax request then use ajax form plugin as well,
this link Ajax From will help you to understand and implement on your page,
but i don't know about codignighter frame work cause i don't have experience of that. And ajax is the best way to distribute the process into different parts with any extra load on the page i mean ajax request will work on the back end..

Uploading and Styling File With PHP and Jquery

I have a form where the admins will be uploading more then 2 pictures at a time, i had been using the basic HTML file input style, however i want to do more with it as i am using a beautiful admin theme from themeforest, (the author haven't included the styled file input element in skin), i want to do it manually. which should meet the following requirement
a) A styled file input element should
be displayed first
b) When the user gives the file input
it should automatically upload the
file using php
c)while uploading the file i want to
see the file upload progress with tool
tip
d)once all the files are uploaded the
user should be able to process the
form with already uploaded file.
I want to admit that i have a very basic understanding of how javascript and Jquery works, however i am quite good at PHP, HTML and CSS.
I want some kinda tutorial regarding how do i style my file input to fill my need.
i am searching something like this.. File Upload
thank you
The only thing that fulfills all your requirements in a way that works with most browsers at the moment is a Flash-based uploader like SWFUpload or Uploadify.
Use SWFUpload. Look its FEATURES DEMO. It has almost everything.

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.

Free java or flash file browser for photogallery

I'm about to develop a small web gallery, where it's supposed to be possible to upload several pictures at a time and then add some info abut the pictures.So I need a free java or flash local file browser that can pass me some info of the pictures that gets uploaded so that I can create some SQL entries for each picture.
The platform for the project will be PHP and MySQL.
Any good recommendations?
I think what you are looking for is SWFUpload.
From the feature list:
Upload multiple files at once by ctrl/shift-selecting in dialog
Javascript callbacks on all events
Get file information before upload starts
Style upload elements with XHTML and css
Display information while files are uploading using HTML
No page reloads necessary
Works on all platforms/browsers that has Flash support.
Degrades gracefully to normal HTML upload form if Flash or javascript is unavailable
Control filesize before upload starts
Only display chosen filetypes in dialog
Queue uploads, remove/add files before starting upload

Categories