Hi Monks

I've had some success with scripts lately, but unfortunately, I haven't been able to upload them to gitlab yet. I was hoping that I might change my luck by starting with a clean slate. I couldn't get my source scripts loaded up to gitlab repo for betelgeuse. I have expended more than 3 strikes thrice. Maybe a change of tactic....

I know I've run scripts from bliako before to create repos on github. I looked through his and my stuff and didn't see anything, nor do I get anything from a super search:

Found 0 nodes roughly between 2023-01-02 and 2012-01-20 (searched 26. +04% of DB). where any text contains all of "create", "repo"

So again, it's looking like a need to start from scratch. This project wants to be an upload page using perl. Let's start with some primitive html:

<!DOCTYPE html> <html> <head> <title>How to upload files using HTML to website?</title> </head> <body> <center> <h1>Welcome to GFG</h1> <h2>How to upload files using HTML to website?</h2> <input type="file" id="file1" name="upload"> </center> </body> </html>

I've spent some time now fishing around the net for best methods, and time before the advent of CE 2023 is very relevant. I wish I could set my browser to get me nothing that is over 5 years old. Heck I'm not too proud to ask:

OT Q1) How do you search the web with a secure anonymous browser that prioritizes recent matches and thinks anything 15 years old is broken?

I don't find a date on is position everything? and not completely sure about geeks for geeks. This part looks about right:

<form method=”post” enctype=”multipart/form-data”> <div> <label for=”profile_pic”> Choose file to upload </label> <input type=”file” id=”profile_pic” name=”profile_pic” accept=”.jpg, .jpeg, .png”> </div> <div> <button> Submit here </button> </div> </form>

Here's another take on the html:

<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv = "Content-Type" content = "text/html; charset=ut +f-8" /> <title>File Upload</title> </head> <body style = "text-align:center;"> <h1 style = "color:green;"> GeeksForGeeks </h1> <form action = "/cgi-bin/upload.cgi" method = "post" enctype = "multipart/form-data"> <p>Upload Photo: <input type = "file" name = "photo" /></p> <p>Email: <input type = "text" placeholder = "e.g. GFG@gmail.com" name = "email_address" /></p> <p><input type = "submit" name = "Submit" value = "Submit Form" /> +</p> </form> </body> </html>

On the perl side, this is where I'm starting:

use CGI; $query = new CGI; $filename = $query->param('file-to-upload'); my ($bytes, $buffer); open (IMAGE, ">image.gif"); while ($byte = read($filename, $buffer, 1024)) { print FILE $buffer; Quote: } close (IMAGE); print "Content-type: text/html\n\n"; print "Done Uploading Image"; exit;

Q2) Do we live in a post CGI-bin world? This looks pretty ancient to be worried about buffers.

Q3) What are preferred and modern ways to do this? (If the answer is PHP, then I don't want to jump syntaxes to do this erstwhile trivial thing.)

This is where it always ends for gitlab now:

fritz@laptop:~/Documents/gitlab1$ ll total 52 drwxrwxr-x 4 fritz fritz 4096 Jan 1 21:24 ./ drwxr-xr-x 10 fritz fritz 4096 Jan 1 21:24 ../ -rwxr-xr-x 1 fritz fritz 1156 Dec 24 22:43 1.2.solstice.pl* ... drwxr-xr-x 2 fritz fritz 4096 Dec 15 21:44 conf_files/ drwxrwxr-x 8 fritz fritz 4096 Dec 25 11:07 .git/ -rw-rw-r-- 1 fritz fritz 14 Dec 19 13:58 README.md fritz@laptop:~/Documents/gitlab1$ git remote -v origin git@gitlab.com:tallharry66@yahoo.com/trans.git (fetch) origin git@gitlab.com:tallharry66@yahoo.com/trans.git (push) fritz@laptop:~/Documents/gitlab1$ git add *.pl fritz@laptop:~/Documents/gitlab1$ git push -u origin master ssh: Could not resolve hostname gitlab.com: Name or service not known fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. fritz@laptop:~/Documents/gitlab1$

I do have this:

fritz@laptop:~/Documents/gitlab1$ ssh -T git@gitlab.com Welcome to GitLab, @tallharry66! fritz@laptop:~/Documents/gitlab1$

, but then I man ssh and realize, I don't even know what this means:

-T Disable pseudo-terminal allocation.

, so

Q4) How do experienced Gitlabers cook up a project from scratch?

Thanks for your comment,


In reply to Using perl to script an upload page by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.