Wordpress type image upload

Posted on 2016-11-03
Last Modified: 2016-11-03
I am not using Wordpress for my current project but when I have used it before I really liked the way it uploads images and manages the uploads. Is there anything similar for download that you can "plug in" to php?

I liked this but there is no ability to delete the image once uploaded:
Question by:Black Sulfur
  • 5
  • 3
  • 2
LVL 109

Expert Comment

by:Ray Paseur
ID: 41872746
This expert suggested creating a Gigs project.
I set up a demonstration of DropZone.js and found that it worked just fine, as far as it goes.  It just lets you drag-and-drop images, and it triggers an upload script.  Poof, the image arrives on your server.  The ability to download or delete an image from the server is a whole different application.  Here are some of the questions that would need programmatic answers for such an application to be viable.

1. Who is allowed to delete images?  
2. How will they be authenticated?
3. Should there be an "un-delete" function?
4. Who is allowed to download images (authentication again)?
5. Will uploaded images have a public-facing URL?

Executive summary: This might be a good one for E-E Gigs.

Author Comment

by:Black Sulfur
ID: 41872764
Thanks, Ray

What I meant about deleting is that in Wordpress you can select a featured image by either uploading or selecting from your library. Then if you aren't satisfied you can just click to remove that image.

With drop zone you can upload the image and it shows you the image. But if I change my mind there is no option to remove it and choose another one.

Something like this:

But I am struggling to customize it.

Author Comment

by:Black Sulfur
ID: 41872767
To answer your questions:

1. Only the site administrator can upload images
2. They will log into their dashboard/admin area to perform uploads when adding a product
3. Not concerned about an undelete function
4. The images aren't really for download, just to display with the product details
5. I am not too sure what this means?
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 41872807
This expert suggested creating a Gigs project.
#5 seems to be answered by #4.  If they are to display product details, you'll want to be able to create HTML <img> tags.  These tags contain a URL in the src= attribute.

Have you tried using dropzone to overwrite images?  If it will overwrite images (and I think it will, depending on the PHP script that is used for file uploads) you might be able to have a "no image available" PNG file or something like that to overwrite the images you want to remove.

I'm asking this because server-side image management is not a question with an answer - it's a project that would be customized in the context of your application.  I still think this is a good place to look to E-E Gigs for some hands-on help.  You can get an explanation of the design strategies from the expert you hire for the gig.

Author Comment

by:Black Sulfur
ID: 41872817
I would be open to the idea of hiring an expert. But the only problem is that I don't have much of a budget and what I am asking for is probably not going to come cheap.

I basically want a wordpress "clone" with regards to how it works on the front end for uploading images and allowing you to enter alt tags and set a featured image and choose more images per product. I don't know what it's doing on the backend though.
LVL 55

Accepted Solution

Julian Hansen earned 250 total points
ID: 41872918
Dropzone is a good option - handling the delete aspect is relatively straight forward.

You should be able to do this with a bit of coaching. There should be a few samples out there using Dropzone and PHP that can get you started.

An image gallery is a fairly straight forward bit of code. You have a loop that builds a list of images (either from a database or from the file system). This can be a simple <ul> list with links bound to jQuery event handlers (Are you sure you want to delete this image) - AJAX call back to server with image ref. PHP code removes the image and sends back the updated list.

If I were you given the inroads you appear to have made - jump in the deep end and give it a go.

Author Comment

by:Black Sulfur
ID: 41872959
Perhaps I should just spend some more time with this:

It has the delete function right out of the box, well to delete the file anyway. There are additional steps to make this talk to the database.

@Julian, you make it sound so easy! :)

To be honest, this uploading files and trying to store in database and trying to integrate with adding of a product is melting my brain. I think a good nights rest and trying again tomorrow will be better.

I am pretty sure I will have a lot of questions :P
LVL 55

Expert Comment

by:Julian Hansen
ID: 41872984
I have used both BlueImp and Dropzone - I prefer the latter.

As with anything in code - break it up into bits. Solve each bit on its own - the solution will follow.

Author Closing Comment

by:Black Sulfur
ID: 41873411
I think I am going to try as Julian has suggested and take it little bit by little bit. If end up tearing my hear out I might have to sell some stuff to try get an EE expert gig going.
LVL 55

Expert Comment

by:Julian Hansen
ID: 41873435
Good choice - you should find that after taking that initial step and getting in to it - you find your way.

Good luck with it.

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question