A
A
ad1vk2014-10-25 13:20:32
JavaScript
ad1vk, 2014-10-25 13:20:32

How to submit a photo from a form using the FileAPI?

Hello! There is the following task: It is

necessary to make a form for sending photos with a progress bar and then sending links to uploaded photos or the photos themselves by email.
I found a script for uploading photos rubaxa.github.io/jquery.fileapi

but I don’t understand how to send photos to email and where are they saved at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sydorenko, 2014-10-25
@San40

fileapi is just the client side.
The server must have a request handler from fileapi, the address of which you specify here as url

$('#simple-btn').fileapi({
   url: '/server/handler.php',
   multiple: true,
   maxSize: 20 * FileAPI.MB,
   autoUpload: true,
   elements: {
      size: '.js-size',
      active: { show: '.js-upload', hide: '.js-browse' },
      progress: '.js-progress'
   }
});

this script /server/handler.php should receive your photos, save them where necessary, generate links to them, and send these links to e-mail.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question