Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Mar 29, 2024 3:40 pm
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject:
PostPosted: Thu Jan 29, 2009 9:15 pm 
Offline

Joined: Thu Jan 29, 2009 5:45 pm
Posts: 12
Location: Canada
Hello,

I'm not able to import rate card as CSV file, it's always comes back with message:
ERROR:
* file type is not allowed: application/x-ms-excel
o .html, .php, .txt, .inc (etc) (text/plain)
o .csv (text/x-comma-separated-values)
o .csv (text/csv)
o .xls (application/vnd.ms-excel)

Trying to upload with min required fields (prefix; destination; rate) and first line of CSV file looks like this:
1193;Afghanistan;0.256816

Someone mentioned a quick fix here on the forum:

Quick and dirty fix:
Open file on 82 line and comment five lines:

nano +82 A2Billing_UI/Public/CC_ratecard_import_analyse.php

Code:
if(count($_FILES) > 0)
{
$errortext = validate_upload($the_file, $the_file_type);
// if ($errortext != "" || $errortext != false)
// {
// echo $errortext;
// exit;
// }
$new_filename = "/tmp/".MDP(6).".csv";
if (file_exists($new_filename))



After this rates upload just fine.


Is there better fix for it or I'm doing something wrong?

Many thanks

Added after 2 hours 11 minutes:

After implementing previously mentioned fix I was able to import CSV file, but I'm not sure if it would cause any problem later on.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 9:38 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Yes you are doing something wrong. You are using Microsoft Windows and Microsoft Office :lol:. Because of that, a simple .csv file appears to your system as being an Excel related document (application/x-m-excel). Technically speaking, the mime type is screwed up. That does not happen on any other plateform or if you didn't have Excel installed. The best thing you can do from now on is to completely forget about .csv and always rename your .csv files to .txt before trying to import the rates. By the way, this solution has been mentionned countless times in the form.

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2009 2:57 am 
Offline

Joined: Thu Dec 11, 2008 7:59 pm
Posts: 19
:D ... I ran into that problem with Micro$oft as well... Solved by switching to non-MS platforms


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2009 2:33 pm 
Offline

Joined: Thu Jan 29, 2009 5:45 pm
Posts: 12
Location: Canada
yes, I did use it (MS) feel guilty now.
I fixed script back and verified that it's working fine with text file.
Thanks for your response guys!
Should I re-import it again or I am going to be fine with this MS file?
Is there might be any issue later on?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2009 3:56 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
You should be just fine. If you feel comfy about manually modify the MIME type of the csv files, feel free to do so. All you need to do is to go under any Explorer windows (NOT Internet Explorer), and Click on Folder Option --> File Types than have fun. If you do it right, you can re-associate .csv files with the MIME type they are supposed to have. Or you can simply make sure that they will be opened with Notepad.

There is another way ... you can go inside regedit (at your own risk) and modify the value located in HKEY_CLASSES_ROOT/.csv

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2009 4:36 pm 
Offline

Joined: Thu Jan 29, 2009 5:45 pm
Posts: 12
Location: Canada
Thanks a lot, asiby, again!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 13, 2009 9:47 pm 
Offline

Joined: Thu Mar 12, 2009 4:02 pm
Posts: 31
Hi Asiby my problem littler bit different, I was not able to import in .csv format so i have saved it in txt format. Now when import it showing me success but with 0 record and showing my whole file under second window.

I cant upload any ratecard now. :(

Please advise whats going wrong here.


Attachments:
ratecard.JPG
ratecard.JPG [ 60.05 KiB | Viewed 12539 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 14, 2009 2:05 am 
Offline

Joined: Thu Mar 12, 2009 4:02 pm
Posts: 31
Could some one help me to get rid of this problem. I cant upload any rate card now. :(


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 14, 2009 4:27 am 
Offline
User avatar

Joined: Wed Aug 20, 2008 9:37 am
Posts: 51
Location: India
It seems your data inside your txt file is not considered while importing. It may be due to wrong text formatting. You can clearly see that all your data is left on import.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 14, 2009 1:55 pm 
Offline

Joined: Thu Mar 12, 2009 4:02 pm
Posts: 31
hi vino,

i am uploading simple txt file, i have tried different ways, like all field as text etc. but nothing is working. every time i am getting same 0 success.

is there any limit for rate card, in the sense number of rate card you can create or number of field per rate card.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 15, 2009 4:04 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
I am not 100% sure. The reason seems to be that you have some blank spaces around the semicolon, also, for a better result, try separating the fields with a colon ( : ) instead of a coma ( , ) or a semicolon ( ; ). And make sure that there are no unneeded spaces around them.

Make sure that you also remove absolutely any tab characters from the rate card file.

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 15, 2009 7:59 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Have you reviewed the help files in respect of creating the export in Excel and Access.

http://www.asterisk2billing.org/cgi-bin ... rtRatecard

I've also found that using IE7, you need to remove the file extension. If importing via IE7 does not work, try Firefox or vice versa

Downloading and using notepad++ for windows can help, as you can sanitise the file for Linux.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 16, 2009 3:41 am 
Offline

Joined: Thu Mar 12, 2009 4:02 pm
Posts: 31
Hi Jroper,

I have tried copying from excel and paste in notepad. as well tried exactly as per link you have sent me.

I have tried : instead of ; but its giving me same problem.

I dont know what happen suddenly, as i remember 4 days ago i have restarted the server and i think from then i having problem.

i am attaching file again as asiby suggested if some one can test with a2b.
I have kept only mandatory field for easy to trouble shoot.

is there any log we can trace why its failing, any setting in a2billing.conf we can play with.

Again thank to all of you who's helping me to fix this issue.


Attachments:
ratecard.txt [310.56 KiB]
Downloaded 512 times
Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 16, 2009 5:57 am 
Offline
User avatar

Joined: Wed Aug 20, 2008 9:37 am
Posts: 51
Location: India
It's so simple man. I dont know why u r struggling.

First, dont copy the data from a excel file. Save the file as csv first, so that the values will be closely separated by commas.

Next, copy that single column from the csv file which has got the entire data and paste it to a notepad.

Use Notepad's "Find and Replace" to replace all occurences of "," to ";" and save it.

Try uploading now n you'll be fine.


Vino


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 16, 2009 3:13 pm 
Offline

Joined: Thu Mar 12, 2009 4:02 pm
Posts: 31
Vinod,

I have tried this one too but giving me same problem. :(

Any idea.

SAjmeri


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group