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 8830817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:10:45+00:00 2026-06-14T08:10:45+00:00

I am trying to create a job application manager in php. The applicant fills

  • 0

I am trying to create a job application manager in php. The applicant fills in their details on the web form and presses submit, it is then added to the mysql database. As part of the form is an upload file box to add a covering letter, this will accept files in doc, docx, pdf, rtf, txt . When the file is uploaded it gets renamed to a hidden field in the form called ‘applicationID’, so a file called My covering letter.doc would become something like 124356456.doc.

The problem I am having is in my application manager I can use while($row = mysql_fetch_array($result)) and then pull out the applicants name etc, but im not sure how to deal with the files. If the file was just named 124356456 I could just link to that using the application id, but because the extension could be a combination of .doc, docx, pdf etc im not sure how to link to it. Ideally it would be something like :

<a href="/pathtofile/124356456.*">View Covering letter</a>

So what im asking is can I link to a file when I don’t know what the extension is, but I know what the file name is ?.

  • 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-06-14T08:10:47+00:00Added an answer on June 14, 2026 at 8:10 am

    You have to store the extension in your database during the upload.

    How to get the extension :

    pathinfo($filename, PATHINFO_EXTENSION);
    

    Another solution is to write a function to check if the file exists and return the correct extension.

    <a href="<?php echo getFile('/pathtofile/124356456'); ?>">View Covering letter</a>
    
    <?php
        function getFile($path) {
            if(file_exists($path.".doc"))
                return $path.".doc";
            else if(file_exists($path.".docx"))
                return $path.".docx";
            else if(file_exists($path.".pdf"))
                return $path.".pdf";
            else if(file_exists($path.".rtf"))
                return $path.".rtf";
            else if(file_exists($path.".txt"))
                return $path.".txt";
        }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a job application-form with Django. Basically, I created two
I am trying to create an application to print documents over the web. I
I'm trying to create am online application for some job postings we have at
I am trying to create, essentially, a 'kiosk' I have an web application that
I'm trying to create a job roster for my Boy Scout Troop, and I'm
I'm trying to create a cron job which will automatically delete .jpg files from
I am trying to create a Jenkins job that restarts a program that runs
I am trying to create a mapper only job via AWS (a streaming job).
I am trying to create a cron job while taking advantage of my current
I am trying to create an application were 2 classes share a variable. Just

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.