• Hello Everyone,
    I am stuck in a problem while building a Digital Business Card on wordpress, Please help me out from this problem:
    What i want to achive:

    I am making an E-business card on hostinger server, in which I want to give the option of “SAVE E-CARD” through which the receiver of that e-card can download the sender information contact number, email id, location, and profile photo.

    Solution Which I know of that problem

    So to achieve this we need to make a vcf file and we have to upload it on our database, under public_html>uploads, which i am doing, then we can create a link which is standard that is https://domainname/uploade/vcffilename.vcf

    Problem:
    But I am unable to achieve this. These steps are taught by my colleague with whom i have not connected anymore and he does these in cpannel.

    Can you please help me out in this situation?

    Regards
    Vaibhav Narang

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    PHP can create the desired files using native PHP functions like fopen(), fwrite(), fclose(). Doing this when a button is clicked can be managed much like a form submittal. Instead of processing form fields, you create .vcf files.

    Where is the card data coming from? If it’s from form fields, you’d just add the file writing process to the usual form handling procedure. If the card creation function is meant only for registered, logged in users, their usual user data could be used to create the card file. The default data can be had with get_userdata( get_current_user_id()). Other user data is likely saved in usermeta, which can be retrieved with get_user_meta().

    What volume of .vcf files are you expecting? While it’s possible to store quite a few files in one folder, there is a limit. You may want to consider some sort of garbage collection routine that deletes older files. This can be done as a WP Cron task or a server Cron job.

    It’s not even necessary to write to a file if its only use is for immediate download. PHP can send a file data stream directly to the client without needing to save the file on the server. It’s mainly a matter of sending the right header information prior to sending the data.

    Thread Starter Vaibhav Narang

    (@narangcreations)

    I am stuck in a problem while building a digital business Card on wordpress, Please help me out with this problem.

    Problem I want to add an option of save the card means save the cotact details directly by just clicking/hiting that button in my digital business card, For that i also created one dedicated folder in my Database for vcf file with the name of Uploads and in this folder i also paste a php file for vcard after guidning by the chat support of hostinger but that only works for that particular vcf file whose name is mentioned in the php but also it is only downloadable not importable (means when we hit the downloaded vcf file then an message apperas Contact couldn’t import) and i want to add lots of vcf file so it means i need to add php files as well.

    Solution Which I know of that problem

    So to achieve this we need to add that vcf file in that upload folder, which i am doing, then we can create a link which is should be like that https://domainname/uploade/vcffilename.vcf. But unfortunatelly it is not happing through this link the coded vcf file available.

    Can you please guide me what the thing i am missing here so that my vcf link works properly and i can also provide the save option.

    Regards Vaibhav Narang

    Moderator bcworkz

    (@bcworkz)

    If you provide the correct file URL within an <a> tag, assuming the file exists and the folder/file permissions are correct, the browser will either open the file or offer a dialog to save it. You can style the link with CSS to look like a button if you prefer.

    If a link is not working, either the URL is incorrect, or the file or folder permissions are incorrect.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Help in Digital Business Card “Save Option”’ is closed to new replies.