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?

        • 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

          • Recent Topics

          • Zoho Mail Desktop Crashes on Linux - Ubuntu 24 LTS

            Hi, I have been trying to run the desktop app on Ubuntu for the past few day with no luck. I have tried both the .deb package and the appImage. When I attempt to open the app. It just crashes immediately. The crash error dialog appeared once and I cant
          • Can't login to Zoho mail

            I'm logged into Zoho but when I try to go in zoho mail I get: Invalid request! The input passed is invalid or the URL is invoked without valid parameters. Please check your input and try again. I just set up my mx records and stuff with namecheap a few
          • Zoho IP blocked by SpamCop

            Hi, Many of my emails are blocked and I receive this:  INVALID_ADDRESS, ERROR_CODE :550, ERROR_CODE :spamcop.mimecast.org Blocked - see https://www.spamcop.net/bl.shtml?136.143.188.51. - https://community.mimecast.com/docs/DOC-1369#550 [DGwIYPPSOfWI
          • Can I execute two 'functions' when completing a mail merge from CRM?

            Hi, I have set up a mail merge from CRM Deals to a template. I want a copy of this to be saved in Workdrive, and then a copy also saved back into the deal record from which the merge occurred. I can do both independent of each other, and managed to get
          • Differences between Zoho Books and Zoho Billing

            Without a long drawn out process to compare these. If you were looking at these Books and Billing, what made you opt for one and not the other. Thanks
          • Auto-sync field of lookup value

            This feature has been requested many times in the discussion Field of Lookup Announcement and this post aims to track it separately. At the moment the value of a 'field of lookup' is a snapshot but once the parent lookup field is updated the values diverge.
          • Custom validation in CRM schema

            Validation rules in CRM layouts work nicely, good docs by @Kiran Karthik P https://help.zoho.com/portal/en/kb/crm/customize-crm-account/validation-rules/articles/create-validation-rules I'd prefer validating data input 'closer to the schema'
          • No Ability to Rename Record Template PDFs in SendMail Task

            As highlighted previously in this post, we still have to deal with the limitation of not being able to rename a record template when sent as a PDF using the SendMail Task. This creates unnecessary complexity for what should be a simple operation, and
          • Server error when trying to Data > Sort > Custom Sort

            Been using Data > Sort > Custom Sort for a while, now it has suddenly stopped working. When selecting the same data range and trying to execute, I get "Sorry! There was a problem saving your last edit. Please try again."
          • To Assign a genrated pdf to a file upload field using delug

            content = "<html><body>HTML Content on page One <div style='page-break-after:always'></div> HTML Content on page Two </body></html>"; file = zoho.file.convertToPDF(content); file.setFileName("Name of the file"); <variableName> = <FormLinkName>[ID == input.ID];
          • TArgets To Accounts (Modules)

            How can i set sale target to Customers (Accounts Module)
          • Breaking barriers with multilingual WhatsApp templates in IM

            Ever wondered what it feels like to be greeted in your own language by a brand you love? A “Welcome!” feels nice, but a “¡Bienvenido!” or “स्वागत है!” feels personal. In today’s global world, conversations often need to cross both time zones and cross
          • Super Admin Logging in as another User

            How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Moderation Update (8th Aug 2025): We are working
          • How to share private Opportunities with whole org at an account level

            Opportunities are currently set to private, so our sales team only sees their own opportunities, along with their manager and upper leadership. The need is the ability for the rest of the Org to see the opportunities at an account level, not within the
          • New in Smart Prompt: Record Assistant for contextual assistance, and support for new AI models

            Smart Prompt helps teams stay informed and move faster by providing relevant suggestions where work happens in CRM. With this update, Smart Prompt becomes more adaptable to your organization’s AI preferences. You can now choose which Large Language Model
          • Subform edits don't appear in parent record timeline?

            Is it possible to have subform edits (like add row/delete row) appear in the Timeline for parent records? A user can edit a record, only edit the subform, and it doesn't appear in the timeline. Is there a workaround or way that we can show when a user
          • Problema Verificacion con proveedor NIC.AR

            No puedo realizar la verificación del correo, he seguido los pasos indicados y configurado los MX. Y no puedo verificar el correo. He leido en el foro que otros han tenido el mismo problema. Alguno pudo solucionarlo?
          • How to remove some users in zoho accounts

            How to remove some users in Zoho accounts.
          • Reupload and rename from one field to another field (file upload)

            Hi Everyone, Sorry, i have question to use invoke url for rename and reupload attachments file to another field. Tested on development mode. Zoho C6. Refer to https://www.zoho.com/creator/help/api/v2/upload-file.html look my error notification. Does anyone
          • Unified Inbox for all, including fetched mails

            I fetch mails from different third-parties mailboxes. But I need to switch mailbox too see fetched mails. It's strange. All mailboxes have one shared disk space for own mail and fetched mail, but why do we need to switch mailbox (on the left bottom) to
          • Whatsapp Limitation Questions

            Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
          • Users Not Automatically Being Added To WorkDrive Team

            I have already created a ticket for this issue, but the support team doesn't seem to understand what's happening. Our organization started with a trial of Zoho Workplace around November 10, 2025. I created 10 users, including myself. I sent out the invites,
          • Synchronization between Gmail and Zoho Mail

            Hello! I am using Zoho Mail within the Zoho One platform. I have completed the basic setup and added all the required DNS records with our domain provider. Our goal is to set up two-way synchronization between our current Gmail inbox and Zoho Mail, but
          • IMAP login problem

            I have my domain hosted with zoho @wilson.ie I have added a new user and have enabled IMAP access to this user account The user can login to zoho mail on the web. When we enter the server settings into Outlook as per below, Outlook cannot login to the
          • Contact data removes Account data when creating a quote

            Hi, Our customer has address fields in their quote layout which should be the address of the Account. They prefill the information, adding the account name - the address data is populated as per what is in the account - great. However when they then add
          • Changes to subform in Zoho CRM Portal Timeline History Unavailable

            Hi Support Team, We have noticed a feature limitation in the Zoho CRM portal. We created a portal for our vendors to edit records directly, but when vendors make updates, the Modified Time and Date fields are not being updated. Additionally, these updates
          • This mobile number has been marked spam. Please contact support.

            Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
          • Zoho CRM Portal Field Level Permission Issue

            Hi Support Team, I am using the Zoho CRM Portal and configuring field-level editing permissions. However, we are unable to restrict portal users from editing certain fields. We have created a portal and provided View and Edit (Shared Only) access for
          • How to restrict user/portal user change canvas view

            Hi , I would like to restrict user / portal user change their canvas view because I hide some sensitive field for them. I dont want my user switch the canvas view that do not belong to them But seems Zoho do not provide this setting?
          • Function #11: Apply unused credits automatically to invoices

            Today, we bring you a custom function that automatically applies unused credits from excess payments, credit notes, and retainer payments to an invoice when it is created. Prerequisites: Create a Connection named "zbooks" to successfully execute the function.
          • Edit Contact Roles in the Potentials Mod

            New to ZOHO so I need some help.  I work the same people on different projects concurrency. Their contact info remains the same but their role changes from project to project.  In the Potential Mod you can pick contacts and assign a Role to them.  I know how to edit the roles. What I want to do is add some fields. Specifically I want to add the following "Expectation" "Requirements" and "Communication "Requirements." This will allow me to look at a Potential and see information associated with this
          • Duplicating report but custom layout does not

            Dear Zoho Creator, I need to duplicate a report into 10 copies, but unfortunately the custom layout (detail view) doesn’t copy along with it. I tried exporting and importing the custom layout, but the field mappings are incorrect. I believe everyone are
          • Credit Card Readers?

            We would like to use our commerce website at conferences (and eventually in store) to swipe credit cards to pay for orders. How would we accomplish this? Does Zoho have anything available for a developer write code to integrate something like Stripe Terminal
          • AI generated meeting notes associated to Account or Deal

            As our organization works to improve efficiency we are looking for a solution to leverage AI to generate meeting notes and then add those notes to a CRM record such as an Account or Deal. I see Zoho has a Notebook AI offering that talks about the ability
          • Stock count by bin location

            Is there a configuration to make a stock count by bin or area and not by product. these is useful to manage count by area Regards
          • Add Prebuilt "Partner Finder" Template with Native Zoho CRM Integration in Zoho Sites To: Zoho Sites Product Team

            Hi Zoho Team, We hope you're doing well. We would like to request a prebuilt "Partner Finder" template for Zoho Sites, modeled after your excellent implementation here: 🔗 https://www.zoho.com/partners/find-partner-results.html ✅ Use Case: Our organization
          • How Do I Refund a Customer Directly to Their Credit Card?

            Hi, I use books to auto-charge my customers credit card. But when I create a credit note there doesn't seem to be a way to directly refund the amount back to their credit card. Is the only way to refund a credit note by doing it "offline" - or manually-
          • Can we generate APK and IOS app?

            Dears, I want to know the availability to develop the app on zoho and after that .. generate the APK or IOS app  and after that I added them to play store or IOS store.. Is it possible to do this .. I want not to use zoho app or let my customers use it. thanks 
          • Limitation with Dynamic Email Attachment Capture

            I've discovered a flaw in how Zoho Creator handles email attachments when using the Email-to-Form feature, and I'm hoping the Zoho team can address this in a future update. The Issue According to the official documentation, capturing email attachments
          • Zoho Learn Course Completion Notifications/Triggers/API

            Zoho Learn works great and will suit our course creation needs, but it appears to be lacking a bit when it comes to integration with other Zoho services (creator etc.) when it comes to course completion. 1) Is there an API or Zoho Flow trigger for when
          • Next Page