Can't upload file to Zoho Docs using API

Can't upload file to Zoho Docs using API

    Hi

    I am using the free version of Zoho Docs and trying to upload a file into the root folder using PHP and the Docs API.

    My source code is as below:

    1. <?php
    2. $cipher = 'rsa_aes_128_sha';
    3. $AUTHTOKEN=" .... ";
    4. $path=" ... ";
    5. $filename=" ... ";

    6. $url = "https://apidocs.zoho.com/files/v1/upload?authtoken=".$AUTHTOKEN."&scope=docsapi";

    7. $fields = array(
    8.             'filename' => $filename,
    9.             'content' => file_get_contents($path."/".$filename)
    10.         );

    11. $ch = curl_init();

    12. $query = http_build_query($fields);

    13. curl_setopt($ch, CURLOPT_POST, TRUE);
    14. curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
    15. curl_setopt($ch, CURLOPT_URL, $url);
    16. curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, $cipher);
    17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

    18. $result .= curl_exec($ch);
    19. echo $result;
    20. curl_close($ch);
    21. ?>

    The result is sometimes a properly formed response which says 'Invalid URL' and sometimes a bizarre string that just says:
    1. <!--$Id$ -->

    The URL format appears to match that shown in the API specification. There are some other possible parameters, but these are clearly stated to be optional.

    I have checked that the filename and path are correct, the file has proper permissions and the file contents are being read okay, and query string being constructed properly. The file size is well under the maximum 100M. Other Docs API functions work okay with the same AuthToken.

    What might be going wrong with the file upload?

        Zoho Campaigns Resources


          • Desk Community Learning Series


          • Digest


          • Functions


          • Meetups


          • Kbase


          • Resources


          • Glossary


          • Desk Marketplace


          • MVP Corner


          • Word of the Day


          • Ask the Experts


            • Sticky Posts

            • [Announcement] Insert image from URL changes in Zoho Writer

              Hi Zoho Writer users! We'd like to let you know that we've changed the behavior of the Insert image from URL option in Zoho Writer for security reasons. Earlier behavior Once you inserted an image URL in a Writer document, the image would be fetched from
            • Deprecation of certain URL patterns for published Zoho Writer documents

              Hi Zoho Writer users! We'd like to let you know that we have deprecated certain URL patterns for published and embedded documents in Zoho Writer due to security reasons. If the published or embedded documents are in any of these URL patterns, then their
            • Introducing plagiarism checker in Zoho Writer

              Zia, Zoho Writer's AI-driven writing assistant, now highlights plagiarized and duplicated content in addition to offering contextual grammar and writing suggestions to help you write clearly and concisely in English. Zoho Writer's plagiarism reports Here
            • [Important announcement] Impact of Google's new email guidelines for Zoho Writer automation users

              Hi users, Google has recently announced new guidelines for sending emails to Gmail and other Google-hosted domains. These guidelines will be effective starting Feb. 1, 2024, and can impact the delivery of emails sent from Zoho Writer. Your organization
            • Transitioning from MS Word to Writer: A complete walkthrough

              Hello everyone! We understand moving to a new word processing tool can be difficult, especially if it means switching from a legacy software like MS Word. That's why we've organized an exclusive webinar where we talk you through ways to make your switch from MS Word to Writer as easy as possible. In this webinar, you'll learn: - Why Writer is a simple yet powerful alternative to MS Word. - How to locate your favorite MS Word features and functions in Writer.  - How to migrate your Word documents

            Zoho CRM Plus Resources

              Zoho Books Resources


                Zoho Subscriptions Resources

                  Zoho Projects Resources


                    Zoho Sprints Resources


                      Zoho Orchestly Resources


                        Zoho Creator Resources


                          Zoho WorkDrive Resources



                            Zoho CRM Resources

                            • CRM Community Learning Series

                              CRM Community Learning Series


                            • Tips

                              Tips

                            • Functions

                              Functions

                            • Meetups

                              Meetups

                            • Kbase

                              Kbase

                            • Resources

                              Resources

                            • Digest

                              Digest

                            • CRM Marketplace

                              CRM Marketplace

                            • MVP Corner

                              MVP Corner




                              Zoho Writer Writer

                              Get Started. Write Away!

                              Writer is a powerful online word processor, designed for collaborative work.

                                Zoho CRM コンテンツ




                                  ご検討中の方

                                    • Recent Topics

                                    • RSC Connectivity Linkedin Recruiter RPS

                                      It seems there's a bit of a push from Linkedin Talent Solutions to keep integrations moving. My Account Manager confirmed that Zoho Recruit is a Certified Linkedin Linkedin Partner but does not have RSC as of yet., (we knew that :-) She encouraged me
                                    • im facing issue on generate the Estimate price

                                      i couldn't understand what is the issue , i cant generate Estimate price where is the issue
                                    • cannot be able to add user

                                      Dear team I tried to add a new user for sales team, but after entering the OTP its showing error message cannot add now
                                    • Changing an existing item to different accounts & inventory-tracked

                                      Hi everyone, I have an item in Zoho Books that was originally set up as a non-inventory item. Over time, I associated it with different sales and purchase accounts, and I now have many invoices, bills, and reports that use this item. My business process
                                    • How do I edit the Calendar Invite notifications for Interviews in Recruit?

                                      I'm setting up the Zoho Recruit Interview Calendar system but there's some notifications I don't have any control over. I've turned off all Workflows and Automations related to the Calendar Scheduling and it seems that it's the notification that is sent
                                    • Bookings duration - days

                                      Hi team, Is there any way to setup services/bookings that span multiple days? I am using Zoho Bookings for meeting room bookings. Clients may wish to book a room for more than one day, for up to a month.  If not, is there a plan to allow services to be setup with durations of Days as well as hours and minutes? Many thanks, Anna.
                                    • big 5 accounts

                                      how do you find what accounts are listed as Big 5 ?
                                    • Zoho recruit's blueprint configuration is not functioning as mapped

                                      Current Status: Zoho Blueprint is not functioning as configured. Issue: We are moving a Candidate status in Zoho Recruit "for active file" but we encountered: "Status cannot be changed for records involved in Blueprint." This happens to various client
                                    • Actual vs Minimum

                                      Hi all, I am sure I am not the only one having this need. We are implementing billing on a 30-minute increment, with a minimum of 30 minutes per ticket. My question is, is there a way to create a formula or function to track both the minimum bill vs the
                                    • Delay in rendering Zoho Recruit - Careers in the ZappyWorks

                                      I click on the Careers link (https://zappyworks.zohorecruit.com/jobs/Careers) on the ZappyWorks website expecting to see the job openings. The site redirects me to Zoho Recruit, but after the redirect, the page just stays blank for several seconds. I'm
                                    • How to add interviews through API

                                      I'm trying to add an interview without much luck. The documentation gives examples of adding just about everything except an interview. However, the issue might be the way I'm formatting it, because the documentation is unclear to me. It seems as if the xml should be passed in the url, which seems unusual. I've tried the data as both plain and character escaped, but nothing seems to work, nor do I even get an error response. https://recruit.zoho.com/recruit/private/xml/Interviews/addRecords?authtoken=***&scope=recruitapi&version=2&xmlData=<Interviews> <row
                                    • Can't scroll the page down unless I refresh the page

                                      Hello, This issue has been going on with me and a lot of other users in my organization, we can't scroll down! the scrolling side bar doesn't appear and scrolling down through mouse or keyboard keys doesn't work, it seems that the page just ends in the
                                    • Offer already made- but I withdrew it

                                      I made an offer letter, but made a mistake on it. I withdrew the offer but now I can't recreate the correct offer. Zoho keeps saying that "A same offer has already been made". I look in the "offers" and there are NO offers (this is the first time I've
                                    • Control the precision of answer bot responses

                                      Hello everyone, Admins can control the precision with which the Answer bot analyzes and generates a response by adjusting the threshold levels. Based on predefined threshold values, Zia analyzes how closely the query matches with the available KB articles.
                                    • Rebrand your CRM with the all-new custom domain mapping setup

                                      UPDATES TO THIS FEATURE! 19th Jan, 2024 — Custom domain mapping has been made available for portal users in Zoho One and CRM Plus. 23rd June, 2023 — Custom domain mapping has been made available for all users, in all DCs. Hello everyone! We are elated
                                    • Add Israel & Jewish Holidays to Zoho People Holidays Gallery

                                      Greetings, We hope you are doing well. We are writing to request an enhancement to the Holidays Gallery in Zoho People. Currently, there are several holidays available, but none for Israel and none for Jewish holidays (which are not necessarily the same
                                    • Sender Email ID is duplicate

                                      My sender id "automate@erplaunchpad.com" is coming as duplicate but I have not used it anywhere else please help
                                    • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

                                      Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
                                    • Building Toppings #6 - Install and uninstall actions

                                      Hello Biginners! In our previous forum post, we explored creating connections - specifically, custom service connections in the Bigin Developer Console. In this post, we'll focus on another feature that can be used in every topping: install actions. We'll
                                    • New UI in Zoho One CRM

                                      Hello, Just switched to the new UI for Zoho One CRM, do not like it, especially the search functions. What are the steps to backstep to the previous UI? UPDATE: I found it.
                                    • App like Miro

                                      Hi all, is there a way to have a interactive whiteboard like in Miro? We want to visualize our processes and workflows in an easy way.
                                    • Important updates to your connectors

                                      Hello everyone, Greeting from Zoho Creator! We're excited to announce that we'll be rolling out significant backend updates to Zoho Creator's built-in connectors to enhance security by following the latest frameworks. The existing version of some of the
                                    • Product Request: Send email to Secondary email

                                      Guys, we should be able to send the campaign to the secondary email too.  Is this on the plans for Zoho Campaign? It looks like I can map the secondary email from the CRM to the Campaigs, but can not send the message.  
                                    • Logic for sending to a non-primary email address

                                      Hi, I have a scenario where contacts are able to sign up for emails with 2 different email addresses (example: work, personal). I've mapped both to Campaigns from Zoho CRM, but when I go to target an email only the primary email addresses are pulling in. How can I update this to look at both of the email addresses - or specifically the secondary email address in Campaigns? Thanks, Jenny
                                    • How Do Mutliple Sales People Prospect in the "LEADS" module without calling the same leads?

                                      We have 4 sales reps and the Leads module does not have real time intuitive knowlodge to make the sales rteps dont call the same people at the same time. How can we crate a fluent prospecting sytem where the salres reps can go out bound without calling
                                    • Keeping track of project expenses

                                      I have talked to a few support techs and it is very hard for me to believe that Zoho's project accounting software can't keep accounts for my projects. I must not understand what they're saying. We get a contract to build something. So the project revenue
                                    • Mailbox delegation - A secure way to enable collaboration

                                      Admins often encounter scenarios where a user needs another team member to access and manage their mailbox during extended leave, role transitions, or while handling high email volumes. In such situations, ensuring business continuity without sharing
                                    • Canvas View bug

                                      I would like to report a bug. When clone a canvas view from an existing canvas view, if the original canvas view have canvas button with client script. Then the new create canvas view will have canvas button, it is make sense. But when I try to delete
                                    • Export blueprint as a high-resolution PDF or image file

                                      This would be a good feature for organizations that want to share the blueprint process with their employees but don't want them to have access to the blueprint in the system settings. At the moment all that users can do is screenshot the blueprint or
                                    • Zoho Recruit Community Meetup - London 🇬🇧 (Venue Finalised)

                                      Hello Recruiters! We’re excited to announce that the Zoho Recruit team is coming to the UK for an in-person Zoho User Group (ZUG) Meetup in London! This is your chance to connect with fellow Zoho users, learn from experts, and walk away with actionable
                                    • Users may not pick the fields to be shown as columns in the Choose Account window when creating a new Deal record

                                      Hi there, by talking with other users I found out that I, as an Admin, am the only one who can pick fields to be shown as columns in the Choose Account window when creating a new Deal record. In fact, if other users click on the "Add Column" symbol on
                                    • 【参加無料】東京 Zoho ユーザ交流会 NEXUS ー AI エージェント (Zia Agents)の活用事例 / CRMで実現するマーケティング業務効率化

                                      ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 3月27日(金)に東京、新橋で「東京 Zoho ユーザー交流会 NEXUS」を開催します! ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー ✒️申し込みはこちらから:https://www.zohomeetups.com/tokyo2026vol1#/?affl=communityforumpost2 ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー ★参加のおすすめポイント ✅ AIエージェント(Zia)のリアルに使える実例を知る
                                    • One Support Email Managed By Multiple Departments

                                      Hello,  We use one support email (support@company.com). Incoming emails come to the "Support Department" and based on what the customer is asking, we route that ticket to different departments (billing, technical support, etc.). When users in these different
                                    • Error AS101 when adding new email alias

                                      Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
                                    • ZOHO.CRM.UI.Record.open not working properly

                                      I have a Zoho CRM Widget and in it I have a block where it will open the blocks Meeting like below block.addEventListener("click", () => { ZOHO.CRM.UI.Record.open({ Entity: "Events", RecordID: meeting.id }).catch(err => { console.error("Open record failed:",
                                    • Python - code studio

                                      Hi, I see the code studio is "coming soon". We have some files that will require some more complex transformation, is this feature far off? It appears to have been released in Zoho Analytics already
                                    • 🚀 WorkDrive 6.0 (Phase 1): Empowering Teams with Content Intelligence, Automation, Accessibility, and Control

                                      Hello, everyone! WorkDrive continues to evolve from a robust file management solution into an intelligent, secure, and connected content collaboration platform for modern businesses. Our goal remains unchanged: to simplify teamwork, strengthen data security,
                                    • Introducing Workqueue: your all-in-one view to manage daily work

                                      Hello all, We’re excited to introduce a major productivity boost to your CRM experience: Workqueue, a dynamic, all-in-one workspace that brings every important sales activity, approval, and follow-up right to your fingertips. What is Workqueue? Sales
                                    • Support Custom Background in Zoho Cliq Video Calls and Meetings

                                      Hello Zoho Cliq Team, We hope you are doing well. We would like to request an enhancement to the video background capabilities in Zoho Cliq, specifically the ability to upload and use custom backgrounds. Current Limitation At present, Zoho Cliq allows
                                    • Upload own Background Image and set Camera to 16:9

                                      Hi, in all known online meeting tools, I can set up a background image reflecting our corporate design. This doesn't work in Cliq. Additionally, Cliq detects our cameras as 4:3, showing black bars on the right and left sides during the meeting. Where
                                    • Next Page