Jump to content


murilo's Content

There have been 10 items by murilo (Search limited from 19-June 20)


By content type

See this member's

Sort by                Order  

#185849 [Solved] Move my account to Tommy

Posted by murilo on 03 May 2021 - 09:30 PM in Escalated Requests

It's a pleasure to contribute to a great service like HelioHost! :D




#185845 [Solved] Move my account to Tommy

Posted by murilo on 03 May 2021 - 08:24 PM in Escalated Requests

Hello, I made a donation and I would like to be moved from Johnny to Tommy.

 

Transaction ID: 0PK931715C392773G

 

Username: murilo

 

Thanks!




#185724 [Solved] Account suspended

Posted by murilo on 28 April 2021 - 12:55 PM in Escalated Requests

Well, I'm going to keep the unlink thing in the code since it doesn't return any errors or problems. I don't know if it's necessary to have references to the shared /tmp folder for Imagick to save files on it. Hope it's now cleaning itself.




#185723 [Solved] Account suspended

Posted by murilo on 28 April 2021 - 12:25 PM in Escalated Requests

My software is a social network. That code uploads an user image to Cloudinary for being attached to their post. I tried running the script without the unlink line and it didn't create any files in my /tmp folder. Something is wrong. The code doesn't make any references to any other places that it could save temporary files. I'm confused now.




#185720 [Solved] Account suspended

Posted by murilo on 28 April 2021 - 12:09 PM in Escalated Requests

Oh, thanks for letting me know about that. I moved the unlink to a line before return and the script still works. Maybe it's cleaning itself now? 




#185718 [Solved] Account suspended

Posted by murilo on 28 April 2021 - 10:34 AM in Escalated Requests

I implemented that line in my script and apparently it worked. It looks like this now:

function uploadImage($file, $width = null, $height = null) {
    if($width !== null && $height !== null && extension_loaded('imagick')) {
        $imagick = new Imagick();
        $imagick->setRegistry('temporary-path', '/home/murilo/tmp');
        $imagick->readImageBlob($file);
        if($imagick->getImageFormat() === 'GIF') {
            $imagick = $imagick->coalesceImages();
            $imagick->cropThumbnailImage($width, $height);
            while($imagick->nextImage()) {
                $imagick->cropThumbnailImage($width, $height);
            }
            $imagick = $imagick->deconstructImages();
        } else {
            $imagick->cropThumbnailImage($width, $height);
        }
        $file = $imagick->getImagesBlob();
    }
    if(empty(CLOUDINARY_CLOUDNAME) || empty(CLOUDINARY_UPLOADPRESET)) {
        return null;
    }
    $mime = finfo_buffer(finfo_open(), $file, FILEINFO_MIME_TYPE);
    $ch = curl_init('https://api.cloudinary.com/v1_1/' . urlencode(CLOUDINARY_CLOUDNAME) . '/image/upload');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['upload_preset' => CLOUDINARY_UPLOADPRESET, 'file' => 'data:' . $mime . ';base64,' . base64_encode($file)]));
    $response = curl_exec($ch);
    $responseJSON = json_decode($response);
    $responseCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
    if($responseCode > 299 || $responseCode < 200) {
        return null;
    }
    curl_close($ch);
    return $responseJSON->secure_url;
    unlink ($file, file, $imagick, 'temporary-path');
}



#185709 [Solved] Account suspended

Posted by murilo on 27 April 2021 - 10:37 PM in Escalated Requests

function uploadImage($file, $width = null, $height = null) {
    if($width !== null && $height !== null && extension_loaded('imagick')) {
        $imagick = new Imagick();
        $imagick->readImageBlob($file);
        if($imagick->getImageFormat() === 'GIF') {
            $imagick = $imagick->coalesceImages();
            $imagick->cropThumbnailImage($width, $height);
            while($imagick->nextImage()) {
                $imagick->cropThumbnailImage($width, $height);
            }
            $imagick = $imagick->deconstructImages();
        } else {
            $imagick->cropThumbnailImage($width, $height);
        }
        $file = $imagick->getImagesBlob();
    }
    if(empty(CLOUDINARY_CLOUDNAME) || empty(CLOUDINARY_UPLOADPRESET)) {
        return null;
    }
    $mime = finfo_buffer(finfo_open(), $file, FILEINFO_MIME_TYPE);
    $ch = curl_init('https://api.cloudinary.com/v1_1/' . urlencode(CLOUDINARY_CLOUDNAME) . '/image/upload');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['upload_preset' => CLOUDINARY_UPLOADPRESET, 'file' => 'data:' . $mime . ';base64,' . base64_encode($file)]));
    $response = curl_exec($ch);
    $responseJSON = json_decode($response);
    $responseCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
    if($responseCode > 299 || $responseCode < 200) {
        return null;
    }
    curl_close($ch);
    return $responseJSON->secure_url;
    unlink ($file);

This is the code. I just added "unlink ($file);" in the end of it. Didn't give me an Internal Server Error, so I guess it's working.




#185707 [Solved] Account suspended

Posted by murilo on 27 April 2021 - 10:17 PM in Escalated Requests

Yea, I found Imagick in my code, it's being used to upload an image to Cloudinary. How can I implement that "unlink()" thing you said? Sorry, I'm new to coding, currently hosting an open source repository and apparently it doesn't clean up after itself.




#185696 [Solved] Account suspended

Posted by murilo on 27 April 2021 - 06:14 PM in Escalated Requests

Oh, I didn't know that! I don't have time to review the code right now, can I clean the /tmp folder manually? Thanks for the help and for removing the suspension from my account. :D




#185691 [Solved] Account suspended

Posted by murilo on 27 April 2021 - 04:13 PM in Escalated Requests

Hello, my account was suspended today. I would like to know the reason for the suspension and if there's any way to remove it. Thanks. :)