3

I'm designing the backend for a blog system. (I'm a beginner) In the page where I create the post I use a big form for title, summary, category, content, tags etc.

Inside this form the committer request to me also the image upload form and the option to crop the uploaded image in 3 different format.

The problem of course is that I don't have uploaded my picture yet (usually I upload picture when I submit the form) but here I need tu upload, crop and save cropped file before submitting my form.

How can I obtain something like this?

My idea is to upload the image using ajax, then I will place a crop button that open a popup with a new page (and a new form) to crop the uploaded image.

I know that if I close the page without submitting form I create "spam", but I can't imagine other ways to obtain this.

Any idea or suggestion?

Roberto Pezzali
  • 2,484
  • 2
  • 27
  • 56

1 Answers1

0

Old or new?
I think you are on the correct track. The answer depends mainly on whether you want to disqualify older browsers or not - with IE8 in mind, for example, there is no easy way to to the whole cropping thing on the browser side.

The good old way
In that case, a I would just go with a directory with temporaries, that you check every now and then and delete files that are more than hour or two old and haven't been moved to permanent storage. Nothing fancy or complicated.

HTML 5
If you can go with just HTML5, there is one nice HTML 5 solution here on SO. See the 'lower' answers too for some other workable solutions.

Community
  • 1
  • 1
Pavel
  • 698
  • 1
  • 11
  • 20