What?
So this is supposed to be a quick article detailing how I used a PHP function to upload a video file to Google Drive. Note that this example does not involve installing the Google Client Library for PHP. So no classes or built-in functions that you didn't write or know what they're doing.

Why?
The objective here is to upload a video file to my Google Drive. This assumes you have already "Enabled the Drive API" via your Google Developers console as well as gotten your OAuth 2.0 access/refresh tokens and specified the appropriate scopes.

The scopes I chose were to do with getting a working example rather than the recommended scope, though you may only need the first (untested):
copyraw
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
  1.  https://www.googleapis.com/auth/drive.file 
  2.  https://www.googleapis.com/auth/userinfo.email 
  3.  https://www.googleapis.com/auth/userinfo.profile 

How?
I've listed below 3 methods, the first follows the manual (or the logic thereof as I don't use the client library) and is a function sending two requests, the second is the appropriate multipart function which uploads and names the file in a single request, and the third is a 'nice-to-have' upload to the specified folder.
Category: Google :: Article: 649

Applies to:
  • FileZilla for Mac
  • macOS High Sierra

A quick note to remind me how to enable FTP directory listing as it was working on my Windows PC but not on my Mac. The error I was getting was
copyraw
Error: Failed to retrieve directory listing
  1.  Error: Failed to retrieve directory listing 
though I could access the folders if I browsed the existing folders by entering it in the remote directory field. Still no files or folders would show.

Category: File Transfer Protocol :: Article: 647

Applies to:
  • CSS
  • HTML
What?
A quick article on how to get a div layer to increase height based on how a heading fits on a page.

What?
I have a heading like this:
The heading in full width
The code of this is:
copyraw
<div id="page-title" class="col-xs-12">
	<h1><a href="/">A long heading that wraps over several lines</a></h1>
</div>
  1.  <div id="page-title" class="col-xs-12"> 
  2.      <h1><a href="/">A long heading that wraps over several lines</a></h1> 
  3.  </div> 
Category: Cascading Stylesheets :: Article: 646

What?
A quick reminder on how to make the carousel in bootstrap compatible with touch devices like smartphones and tablets.

Why?
Feed back was that the user was unimpressed with the image slideshow. You have to tap on the left and right symbols...

How?
Some will suggest to load the jQueryMobile library but that started messing up the template layouts for me. I really like the solution (and think it should be voted best answer) put forward by Mark Shiraldi:

Sometimes it is critical to ensure a group of queries are all executed successfully to maintain the integrity of our data. Let's say we have a banking app where we need to subtract funds from one account and add funds to another:

copyraw
$mysqli->query ("UPDATE 'accounts' SET 'balance' = 'balance'-1000000 WHERE 'user' = 'Bob'");
$mysqli->query ("UPDATE 'accounts' SET 'balance' = 'balance'+1000000 WHERE 'user' = 'Fred'");
  1.  $mysqli->query ("UPDATE 'accounts' SET 'balance' = 'balance'-1000000 WHERE 'user' = 'Bob'")
  2.  $mysqli->query ("UPDATE 'accounts' SET 'balance' = 'balance'+1000000 WHERE 'user' = 'Fred'")

What if one of the queries fails? To mitigate the chances of misplacing our millions due to some possible error we must ensure that both queries are executed with the expected result before committing any changes to the data. This where transactions are useful. We can run the queries, then check if some conditions are met before committing the changes in the data:

Category: MySQL :: Article: 644

Applies to:
  • Windows Live Mail 2012
What?
A quick article on how to update the Microsoft Live Server URL for Hotmail using Windows Live Mail. Well how to deactivate an account and set up a new one in Windows Live Mail. If you used IMAP all along then the new account will have all your mail.

The error
copyraw
Unable to send or receive messages for the Hotmail (someone) account.

Subject 'your Microsoft Issue'
Server Error: 3219
Windows Live Mail Error ID: 0x8DE00005
Unable to send or receive messages for the Hotmail (someone) account.

Server Error: 3219
Server: 'https://mail.services.live.com/DeltaSync_v2.0.0/Sync.aspx'
Windows Live Mail Error ID: 0x8DE00005
  1.  Unable to send or receive messages for the Hotmail (someone) account. 
  2.   
  3.  Subject 'your Microsoft Issue' 
  4.  Server Error: 3219 
  5.  Windows Live Mail Error ID: 0x8DE00005 
  6.  Unable to send or receive messages for the Hotmail (someone) account. 
  7.   
  8.  Server Error: 3219 
  9.  Server: 'https://mail.services.live.com/DeltaSync_v2.0.0/Sync.aspx' 
  10.  Windows Live Mail Error ID: 0x8DE00005 

How?
I don't remember the time when the Microsoft website became helpful but as they already have an article on this, I'm going to do a bunch of screenshots:
Category: Windows OS :: Article: 643

What?
A quick article to stop me running into this issue again. This article serves to address the issue of importing characters from an XML in a different language character set and trying to load it in PHP with the function simplexml_load_string(). The error I get is something similar to:

PHP Warning:
simplexml_load_string(): Entity: line #: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xA0 0x3C 0x2F 0x73 in /home/public_html/my_folder/my_xml_processing_script.php on line 160


Why?
I'm downloading an XML feed to our servers, and then loading the downloaded file into memory with simplexml_load_string(). I get the above error when it is attempting to load an XML feed which is mostly in Spanish and breaks at the following XML node:

copyraw
<baños>2</baños>

-> yields issue: PHP Warning:  simplexml_load_string():     <baños>2</baños> in /home/public_html/my_folder/my_xml_processing_script.php on line 160

should read

<baños>2</baños>
  1.  <baños>2</baños> 
  2.   
  3.  -> yields issue: PHP Warning:  simplexml_load_string():     <baños>2</baños> in /home/public_html/my_folder/my_xml_processing_script.php on line 160 
  4.   
  5.  should read 
  6.   
  7.  <baños>2</baños> 


How?

Category: Personal Home Page :: Article: 642

What?
A quick article on how to trim in MySQL along with getting rid of any leading or trailing tab characters.

Why?
I use MS Excel for organizing data and then converting to MySQL commands. Unfortunately, the MS Excel software adds tab characters to delimit the columns...

How?
UPDATE `mytable` SET `myColumn` = TRIM(CHAR(9) FROM TRIM(`myColumn`));
Source: Stack Overflow - How to Remove Tabs

What?
A quick article showing my MySQL statement when I want to remove all the accents from foreign characters and return the English equivalent.

Why?
A content management system (CMS) that I'm working on has just gone international and started including the names of places in other countries. This is nice but its search engine doesn't work properly as it thinks "riviere" is different to "rivière". We need to ensure that a search for any of these kind of words will return results of similarly typed/sounding words.

How?
Here's just a splurge of SQL but I use this often enough:

What?
A quick article on how I displayed feeds from the company's social network pages in one page.

Why?
There are 3rd-party apps that let you do this, some paid, some not. This was for a staff portal so I wanted this at no extra cost. This is read-only so actual editing of the feed would be done on the respective social network's site.

How:
This simply displays the feed... (no write back)

Applies to:
  • Apimo Webservice 2.0 (apimo.com)
  • PHP v5.5
What?
This is an article on how I connected to the Apimo WebService. The Apimo Webservice is an API provided by apimo.com and requires a server request over HTTPS using the GET method.

Why?
This was quite difficult to connect to and to determine what was wrong with each step of the development as the error messages were somewhat vague. I thought I'd quickly write this article so I don't have to spend so much time on it again.

Note that the below examples, demonstrate a script on a Non-SSL-Enabled host.

How?

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

RSS Feed

Related Articles

Joes Revolver Map

Joes Word Cloud

system   files   joomla   would   case   date   report   database   server   function   code   used   zoho   display   data   added   error   form   need   parameter   create   source   file   windows   user   order   time   version   find   where   using   work   deluge   license   uploaded   following   list   name   script   first   client   note   google   table   website   creator   value   mysql   field   page   JoelLipman.Com

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.