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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:56:08+00:00 2026-06-08T19:56:08+00:00

I created an upload file in html and a php file for inserting audio

  • 0

I created an upload file in html and a php file for inserting audio file name into table,uploading to particular folder in server. Everything works fine if i use simple php coding like this:

<?
require 'dbconnect.php';
$audio=basename($_FILES['file']['name']);
$audio=str_replace(' ','|',$audio);
//$date=date('YmdHis');


$audio=$audio.".mp3";
$tmppath1="audios/".$audio;
move_uploaded_file($_FILES['file']['tmp_name'],$tmppath1);
$query="INSERT INTO `tbl_audio` (`audioname`, `guid`) VALUES ('$audio', '$guid');";
$res=mysql_query($query);
if($res)
{
$message=array("message"=>"uploaded");
$query1="select * from tbl_audio order by date desc";
$res1=mysql_query($query1);
$row1=mysql_fetch_row($res1);
if($row1[1])
{
$audiopath="http://test.com/audios/".$row1[1];
/* get the short url */
$short_url = get_bitly_short_url($audiopath,'XXXXXXXXX','XXXXXXXXXXXX');
}
else
{
$audiopath="";
}
$message=array("audioid"=>$row1[0],"audiopath"=>$short_url,"key"=>"uploaded","guid"=>$row1[3],"audioname"=>$row1[1]);
}
else
{
$message=array("message"=>"failed to upload");
}
}
echo json_encode($message);

But my superior told not to directly display the actual path of audio file and name,instead use jwplayer to hide it.
the code look like:

<script type='text/javascript' src='jwplayer/jwplayer.js'></script>

<div id='mediaplayer'></div>

<script type="text/javascript">
  jwplayer('mediaplayer').setup({
    'id': 'playerID',
    'width': '480',
    'height': '270',
    'file': 'http://test.com/test/audios/Testaudio.mp3',
    'modes': [
        {type: 'html5'},
        {type: 'flash', src: 'http://test.com/jwplayer/player.swf'},
        {type: 'download'}
    ]
  });

I am able to play the audio in browser. but how to change the url generated and give it as response to developer?
what i want is to get the url path of the audio file with out its name like player.php?id=abc
I used bitly api to reduce path
Please help,
Thanks…

  • 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-08T19:56:09+00:00Added an answer on June 8, 2026 at 7:56 pm

    I guess you need to modify the header.

    inside the player.php you do the logic to find the physic path to the file you wan’t to contribute.

    then you have to change the header

    here is an example in the first answer

    Setting up apache to serve PHP when an MP3 file is requested

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

Sidebar

Related Questions

html form <form action=upload.php method=POST enctype=multipart/form-data> <input type=file name=file /><p /><input type=submit value=Uplaod />
I created uploads folder on the server, and a file uploaded by a user
I've created a HTML and PHP form to pretty much just input data into
Every 72 hours I upload a new PHP file to my server. (well actually
I am trying to create a PHP file to upload images to my website.
i am created one function to upload image with random name and it worked
I have created a form to upload a a newsletter into the database. I'm
I have created a script that will upload files to a general uploads folder,
I have created a program which allows me to upload images to my server.
I'm having trouble using PHP to SFTP upload files to a remote server. When

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.