i have been trying to upload music file but the file will not upload but all the picture upload are successfully .

i need some help . i want to upload music file to a directory in my server but i have been having problems with it. unable to upload full mb song

Recommended Answers

All 4 Replies

Sounds like you've reached the size limit. Check the contents of $_FILES array by placing this at the top of your upload script:

die(print_r($_FILES));

Then check the value of the index key error, if you get 0 there's no errors, so you will may want to paste your code here. If instead the value is different, for example 2 then it's a size problem and in this case you have to change some settings in your php.ini file, like upload_max_filesize, which by default is 2MB. For more information read these links:

i have done changes in php.ini file
its working fine on my localhost
but when i upload it to server the large song is not moved to the directory
it saves to database
but the small song like tune moves

The remote server needs to be reloaded otherwise it will not read the new settings in the php.ini file. Otherwise you can use ini_set():

<?php

    ini_set('upload_max_filesize', '20M');
    ini_set('memory_limit', '128MB');
    ini_set('max_execution_time', 180); # 3 minutes

By the way, do you get errors when you try with a big file? Have you checked the error log of the server?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.