I am working on a blockchain based image sharing website in Ethereum:-
function uploadImage(string memory _imgHASH,string memory _description ) public{ //making sure image ipfs hash exist require(bytes(_imgHASH).length > 0); //making sure that the image description exist require(bytes(_description).length > 0); require(msg.sender != address(0)); //increment image id imageCount ++; //add image to contract images[imageCount] = Image(imageCount,_imgHASH,_description,0,msg.sender); //trigger an image emit ImageCreated(imageCount, _imgHASH, _description, 0, msg.sender); }
This is how you upload images but now I want users to delete images created by them. How do I do it? Any help will be appreciated!!