OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

CloudConvert API import/upload task always marked as "Waiting for Upload"

  • Thread starter Thread starter Jerry Will
  • Start date Start date
J

Jerry Will

Guest
This is my first time using the CloudConvert API, and I attempting to perform HTML to PDF file conversion. I have read/followed the official documentation as well used the provided "Job Builder," but no matter what I try, the import/upload task is always stuck as "Waiting for Upload".

Of course, I didn't expect the program to work on the first try, but the file won't upload; there aren't any errors either. The file I'm attempting to upload is main.html, which is in the same directory as my Python file. Here is my code:

Code:
cloudconvert.configure(api_key='API_KEY', sandbox=False)
job = cloudconvert.Job.create(payload={
    "tasks": {
        "import-file": {
            "operation": "import/upload",
            "input": "upload",
            "file": "main.html"
        },
        "convert-pdf": {
            "operation": "convert",
            "input_format": "html",
            "output_format": "pdf",
            "engine": "chrome",
            "input": [
                "import-file"
            ],
            "zoom": 1,
            "print_background": True,
            "display_header_footer": False,
            "wait_until": "load",
            "wait_time": 0,
            "filename": "main.pdf"
        },
        "output-schedule": {
            "operation": "export/url",
            "input": [
                "convert-pdf"
            ],
            "inline": False,
            "archive_multiple_files": False
        }
    },
    "tag": "jobbuilder"
})

I know there was an issue a few years ago on CloudConvert's end that caused all uploaded files to be marked as "waiting." Is there something wrong with my code, or could it be a repeat of that situation?
<p>This is my first time using the CloudConvert API, and I attempting to perform HTML to PDF file conversion. I have read/followed the official documentation as well used the provided "Job Builder," but no matter what I try, the import/upload task is always stuck as "Waiting for Upload".</p>
<p>Of course, I didn't expect the program to work on the first try, but the file won't upload; there aren't any errors either. The file I'm attempting to upload is main.html, which is in the same directory as my Python file. Here is my code:</p>
<pre><code>cloudconvert.configure(api_key='API_KEY', sandbox=False)
job = cloudconvert.Job.create(payload={
"tasks": {
"import-file": {
"operation": "import/upload",
"input": "upload",
"file": "main.html"
},
"convert-pdf": {
"operation": "convert",
"input_format": "html",
"output_format": "pdf",
"engine": "chrome",
"input": [
"import-file"
],
"zoom": 1,
"print_background": True,
"display_header_footer": False,
"wait_until": "load",
"wait_time": 0,
"filename": "main.pdf"
},
"output-schedule": {
"operation": "export/url",
"input": [
"convert-pdf"
],
"inline": False,
"archive_multiple_files": False
}
},
"tag": "jobbuilder"
})
</code></pre>
<p>I know there was an issue a few years ago on CloudConvert's end that caused all uploaded files to be marked as "waiting." Is there something wrong with my code, or could it be a repeat of that situation?</p>
 

Latest posts

Top