corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Html5 image uploader / PHP image uploader / Magento Image Uploader


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Html5 image uploader / PHP image uploader / Magento Image Uploader
Whittie
Member

Registered: 11th Aug 06
Location: North Wales Drives: BMW, Corsa & Fiat
User status: Offline
24th Oct 12 at 11:20   View User's Profile U2U Member Reply With Quote

My last magento post this week, promise

Basically, customers are abled to upload up to 1000 images, maybe more, I need a way of doing this and relating it to the correct customer.
It's pretty much a dead cert that it has to be standalone as Magento would shit itself, it barely allows 1 jpg and that's under 2mb limit... Oscommerce is out of the question (Gaz), as i've just spent a long time working on the theme, addons and template, it's all ready to go.

On the order page once the customer has paid, they'll have options, upload as a zip / rar folder or i'd like them to be linked to an image uploader that only relates to them somehow.

The html 5 one is rather epic: http://html5demos.com/dnd-upload can see it previews and uploads to the server no problem. How would I make it so it's only obvious to each customer though, someone could do an epic upload of 800 photos and someone else uploads 60 inbetween them all.

Only ways I can think around it are getting the customer to rename their photo's to the order number, but this will make me look silly, write some kind of script to link with the last X amount of order numbers in Magento and get them to tick that it is their corrosponding order and it'll rename images automatically?

Other way I thought would be to confirm the order and they'll get an email back and i'll send them their own login to project send, which can be re-branded...? ( http://code.google.com/p/clients-oriented-ftp/ )

Dom
Member

Registered: 13th Sep 03
User status: Offline
24th Oct 12 at 11:34   View User's Profile U2U Member Reply With Quote

Grab the filename(s) prior to uploading, bit of AJAX, dump to DB table and link to the customer.

I'd also check out Uploadify and the HTML5 version of that; shed load of functionality and, iirc, it supports chunking.
Whittie
Member

Registered: 11th Aug 06
Location: North Wales Drives: BMW, Corsa & Fiat
User status: Offline
24th Oct 12 at 11:39   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Dom
Grab the filename(s) prior to uploading, bit of AJAX, dump to DB table and link to the customer.

I'd also check out Uploadify and the HTML5 version of that; shed load of functionality and, iirc, it supports chunking.


Just googled Uploadify and all the links i'd been on. I remember coming to the conclusion that i'd fuck it up on the DB side and spend too long get it working. Is it fairly simple to do?
Dom
Member

Registered: 13th Sep 03
User status: Offline
24th Oct 12 at 12:09   View User's Profile U2U Member Reply With Quote

If you were to use Uploadify then there is a 'onUploadSuccess' event which triggers on each successful upload. So you can either fire off an AJAX request (to server-side page) with the filename (use 'file.name' property) and customer ID on each trigger or stick the filenames into a delimited string or use an array and then fire off a single AJAX request with that string/array + customer ID when the 'onQueueComplete' event triggers (which is once the entire queue is processed).

The server-side/php is simply taking the filename(s) and inserting rows into a table along with the customers ID.

You then end up with a directory full of files and a table linking the customer id to individual filenames. You then do what you want with the data eg - could get it compress customers order files then send you an email with them etc etc


Edit - Another solution is to create a new directory for each session/order with customer details and bung the files into that ie: -
/uploaded_files/session_23487_customer_2/ (files)
/uploaded_files/session_27812_customer_2/ (files)
/uploaded_files/session_15673_customer_876/ (files)

I'm sure you get the idea.

[Edited on 24-10-2012 by Dom]
noshua
Member

Registered: 19th Nov 08
User status: Offline
24th Oct 12 at 17:27   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Dom
Grab the filename(s) prior to uploading, bit of AJAX, dump to DB table and link to the customer.



Seems the easiest option - generate a random identifier with something like the timestamp to prefix all the images or a folder to prevent image overwrites and what not.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
What image uploader do you use? alnmcn General Chat 4 203
29th Aug 03 at 21:17
by Drew
 
Caste Combe today..(pics)..56k warning Sidesport General Chat 32 610
24th Apr 04 at 21:08
by Demo
 
Pics from Crail!!! Skipz Scotland 10 1038
7th May 04 at 19:01
by Xs
 
Ecommerce Site - Does this plugin exist anywhere? Whittie Geek Day 29 965
16th Jan 11 at 22:11
by Gary
 

Corsa Sport » Message Board » Off Day » Geek Day » Html5 image uploader / PHP image uploader / Magento Image Uploader 29 database queries in 0.0094030 seconds