Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 662501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:23:07+00:00 2026-05-13T23:23:07+00:00

I have a Perl script which will allow for a file to be uploaded

  • 0

I have a Perl script which will allow for a file to be uploaded to my server. I’m not completely done with it yet, but I would like to know, if there is any way for me to get the full path of a file i uploaded. Shouldn’t this be possible by checking the PATH_INFO environment variable, but when i try to check the path info, nothing is there

#!/usr/bin/perl
use strict;
use CGI;
use File::Basename;


#Virtual Directory


eval
{

    my ($uploadfile, $cgi);
    $cgi = new CGI;
    $uploadfile = $cgi->upload('uploadfile');
    print $uploadfile;

use constant PASSWORD => 'p3rlD3v3l0p3r';
use constant UPLOAD_DIR => '/home/user/files';




print <<"HTML";
Status: 200 OK
Content-Type: text/html

<html>
    <head>
       <title>Virtual Directory</title> 
    </head>
    <body>
    $uploadfile
       <h2>Upload a new file</h2>
       <form method = "POST" enctype = "multipart/form-data"  action =""/>


          File:<input type = "file" name="uploadfile"/>



             <p>Password:
              <input type = "password" name ="passwd"/></p>
             <p><input type = "submit" value= "Submit File" /></p>


       </form>

    </body>


</html>

HTML


print $ENV{"PATH_INFO"};
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:23:08+00:00Added an answer on May 13, 2026 at 11:23 pm

    It is hard to make sense of your question. However, do read Processing a File Upload Field in CGI docs. I think you might be looking for:

    Accessing the temp files directly

    When processing an uploaded file, CGI.pm creates a temporary file on your hard disk and passes you a file handle to that file. After you are finished with the file handle, CGI.pm unlinks (deletes) the temporary file. If you need to you can access the temporary file directly. You can access the temp file for a file upload by passing the file name to the tmpFileName() method:

    On the other hand, if you are trying to find out the full path of the file on the web site visitor’s computer, I hope it should be obvious that there is no way for your script to retrieve this information if it is not submitted by the user’s browser as the name of the file:

    If you want the entered file name for the file, you can just call param():

    $filename = $q->param('field_name');
    

    Different browsers will return slightly different things for the name. Some browsers return the filename only. Others return the full path to the file, using the path conventions of the user’s machine. Regardless, the name returned is always the name of the file on the user’s machine, and is unrelated to the name of the temporary file that CGI.pm creates during upload spooling

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 408k
  • Answers 408k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is a functional programming thing. Mutating Account by doing… May 15, 2026 at 6:44 am
  • Editorial Team
    Editorial Team added an answer Try this: http://www.a2zdotnet.com/View.aspx?id=77 And remember to use [Authorize] attribute on… May 15, 2026 at 6:44 am
  • Editorial Team
    Editorial Team added an answer The limitation of the literal object syntax is that the… May 15, 2026 at 6:44 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.