Skip to content

Instantly share code, notes, and snippets.

@SwapnilSoni1999
Created December 14, 2018 10:00
Show Gist options
  • Save SwapnilSoni1999/28f721eb3877ad730400928debfba835 to your computer and use it in GitHub Desktop.
Save SwapnilSoni1999/28f721eb3877ad730400928debfba835 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc,char* argv[])
{
if(argc==1) {
printf("\033[0;31m");
printf("\nNo filename provided! Exiting...");
printf("\033[0m \n");
exit;
}
else if(argc==2)
{
int lmao=0;
char filename[128];
char command[512] = "curl --upload-file ";
char website[128]= " https://transfer.sh/";
int FILENAME_DEFINED = 0;
for(int i=0; i<argc; i++) {
if(lmao == 1) {
strcpy(filename,argv[i]);
FILENAME_DEFINED = 1;
}
lmao++;
}
if(FILENAME_DEFINED) {
strcat(command, filename);
strcat(website, filename);
strcat(command, website);
}
system(command);
//printf(command);
}
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment