Downloading VCF file created by PHP with Safari doesn't work, all ok with Android and Windows - iphone

This link works EVERYWHERE: https://www.autobackoffice.com/vcard.php
And this is the content of the file:
<?php
header('Content-Type: text/x-vcard; charset=utf-8;');
header('Content-Disposition: attachment; filename=vcard.vcf"');
echo "BEGIN:VCARD\n";
echo "VERSION:3.0\n";
echo "N:My Name\n";
echo "FN:Yet another Name\n";
echo "URL:https://www.google.com\n";
echo "ORG:Organization\n";
echo "EMAIL:info#google.com\n";
echo "PHOTO;VALUE#URI;TYPE#JPG:https://www.autobackoffice.com/mv/media/logohp.jpg\n";
echo "TEL;TYPE=voice:1234567890\n";
echo "ADR;TYPE#WORK,PREF:;;Long Way Avenue\n";
echo "REV:2022-01-26T12:13:14Z\n";
echo "END:VCARD\n";
?>
But if I simply "embed it" here:
<a href='vcard.php' download='test.vcf'>Click to download</a>
then it doesn't work on iPhone/Safari.
You can test it here: https://www.autobackoffice.com/vcard2.php
The content of vcard2.php is EXACTLY that single a href line above.

Related

SQL Loader INFILE with file in a different path

I have a SQL Loader Control File in the directory /opt/TEST/app/ITT/script/ctl/.
The input file is in the directory /opt/TEST/app/ITT/in/.
The SQL Loader Control File can't stay in the same directory of the input file, so I must take it putting the right directory.
Is it correct to write this code in the control file?
LOAD DATA
INFILE '/opt/TEST/app/ITT/in/FILE1.ready'
BADFILE '/opt/TEST/app/ITT/in/FILE1.bad'
DISCARDFILE '/opt/TEST/app/ITT/in/FILE1.dsc'
I would prefer to do something easier without writing the whole directory, but just to got back from /ctl/ to /ITT/ and then to enter in the /in/ directory but I don't know how to do it.
find /u01/*/*/tmp/*_OCI/*.csv | while read INFILE
do
echo load data > /u01/tmp/temp_ctl.ctl
echo infile "'$INFILE'" >> /u01/tmp/temp_ctl.ctl
echo append into table cons_sqldata >> /u01/tmp/temp_ctl.ctl
echo fields terminated by "','" >> /u01/tmp/temp_ctl.ctl
echo '('db_name, >> /u01/tmp/temp_ctl.ctl
echo cons_grp, >> /u01/tmp/temp_ctl.ctl
echo sql_count, >> /u01/tmp/temp_ctl.ctl
echo sql_execs')' >> /u01/tmp/temp_ctl.ctl
chmod 755 /u01/tmp/temp_ctl.ctl
echo
echo invoking the sql*loader
echo using table $INFILE
sqlldr userid=test/test#123#test_f control=/u01/tmp/temp_ctl.ctl
echo "****************************************************************"
done
According to this documentation, the INFILE path has to be surrounded by single qotes:
https://docs.oracle.com/cd/B10501_01/server.920/a96652/ch05.htm#1008018
Example:
INFILE 'c:/topdir/subdir/datafile.dat'

WAMP server stops form actions? CodeIgniter

Key Point: Submit buttons for a form won't work on WAMP server.(Using form helper)
Works on University server. Doesn't on WAMP server.
I have been creating some simple forms that adds details that are entered into a database on phpMyAdmin. I had a lot of trouble getting the submit button to work on my form but managed to fix it when I ran the site on the University server. It seems that form submit buttons don't work with WAMP servers. Any ideas?
The button has no response at all on WAMP.
<?php
echo form_open('site/inputWorker');
echo form_label('Forename:', 'Forename');
echo form_input('Forename');
echo "<br>";
echo form_label('Surname:', 'Surname');
echo form_input('Surname');
echo "<br>";
echo form_label('Skill1:', 'Skill1');
echo form_dropdown('Skill1', $skills, 'None');
echo "<br>";
echo form_label('Skill2:', 'Skill2');
echo form_dropdown('Skill2', $skills, 'None');
echo "<br>";
echo form_label('Skill3:', 'Skill3');
echo form_dropdown('Skill3', $skills, 'None');
echo "<br>";
echo form_label('Availability:', 'Availability');
echo form_dropdown('Availability', $availability, 'None');
echo "<br>";
echo form_submit('Add Worker', 'Add Worker');
echo form_close();
?>

CQLSH: How to print text on execution of >source 'CommandFile';

I am using these functionalities:
Linux>cqlsh
cqlsh>use mydatabase;
cqlsh:mydatabase>source 'myCommands.cqlsh';
...
cqlsh:mydatabase>
Since I am executing a file, I wish to comment some outputs, I would like to find a way to print a sort of echo '' or print "hello"; on the output. Is it possible ?
You could just script this out, piping your split CQL scripts to cqlsh:
#!/bin/sh
echo "SOURCE 'myCommands1.cql'" | cqlsh
echo "hello"
echo "SOURCE 'myCommands2.cql'" | cqlsh
echo "done.."

Unix Email shell script not getting the To: from email

Hi I wrote a shell script. This shell script sends my file.html file out. Everything is great but it seems when I receive the file it does not have a To : address. For example it would look like this instead of this.
**Looks like this**
Report
To :
Body : TONS OF INFO HERE.
**Want it to look like this in email**
Report
To: Bob#aol.com
Body : TONS OF INFO HERE.
My Script
#!/bash/bash
Email()
{
export MAILTO="bob#aol.com"
export CONTENT="File.html"
export SUBJECT="Report"
(
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
cat $CONTENT
) | /usr/sbin/sendmail $MAILTO
}
Email
Try
MAILTO='bob#aol.com'
or
MAILTO="bob\#aol.com"
The # character indicates an array variable in bash, and # characters in double-quote marks are expanded.
Trying adding another echo to separate the contents from the header:
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
echo
Also quote your variables well to prevent word splitting and pathname expansion.
cat "$CONTENT"
/usr/sbin/sendmail "$MAILTO"

Possible to send attachment from Unix to Outlook with long lines?

I'm trying to send an email with a csv attachment from a Unix box to a recipient who is using Outlook 2010. The csv has very long lines (approx. 2000 - 3000 characters).
The file is fine on Unix but when the recipient receives the file there are extra exclamation marks(!) and new lines approx every 1000 characters. Here is some example code I've tried:
outputFile="/tmp/testemail"
attachFile="/tmp/test.csv"
(
echo "From: sender#somedomain.com"
echo "To: receipent#someotherdomain.com"
echo "Subject: Test"
echo "Mime-Version: 1.0"
echo 'Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw"'
echo "Content-Disposition: inline"
echo ""
echo "--GvXjxJ+pjyke8COw"
echo "Content-Type: text/plain"
echo "Content-Disposition: inline"
cat $outputFile
echo ""
echo "--GvXjxJ+pjyke8COw"
echo "Content-Type: text/csv"
echo "Content-Disposition: attachement; filename=test.csv"
echo ""
cat $attachFile
) | /usr/lib/sendmail -t
I've also tried going through the different types of content-transfer-encoding listed here: https://en.wikipedia.org/wiki/MIME#Content-Transfer-Encoding. But none seemed to help.
Sendmail breaks long lines (>990 chars) send over SMTP -> you should send the files using quoted-printable encoding. You may use e.g. qprint program for conversion.
quoted-printable encoding handle "too long" lines.
You may also consider specifying charset used (e.g. ISO-8859-1 or UTF-8) or US-ASCII will be assumed as default.
...
echo "Mime-Version: 1.0"
echo "Content-Type: text/csv; charset=utf-8"
echo "Content-Transfer-Encoding: quoted-printable"
echo "Content-Disposition: attachement; filename=test.csv"
echo ""
qprint -e $attachFile
...