CKAN resource file upload by api? - api

How do I upload file in to resource (either create or update)in CKAN using apis.
I followed the documentation it seems working but getting an error at datapusher page.
Click here for Image of Error

this error indicates a time-out when the datapusher service tries to download the resource from CKAN.
#florianm is dead right here.
Another thing to check is the resource url. The exception suggests you've forgotten to put http:// on the front of the url, or something similar.
Also note that you can upload files directly to CKAN if they are not already on-line somewhere else.

#Vithal this error indicates a time-out when the datapusher service tries to download the resource from CKAN.
Some pointers:
What do your CKAN and datapusher error logs say?
How big is your resource file?
Does this error occur when you upload a tiny CSV file?
Does this error occur when you upload your original resource file to
demo.ckan.org?

Related

Getting 404 while trying to preview a newly edited office document in ngx doc viewer Angular

I'm working on ngx-doc-viewer in angular and when I'm trying to get a document preview of Docx file I'm getting 404 in one case.
I'm uploading my document to a blob storage and giving that blob URL for the file URL of the document.
Normally, If I upload a docx file to blob storage and using that blob URL to get the preview I'm getting the document preview properly
When uploaded document normally
But when I edit a document using wps office(not sure if it will happen with other editors also) and immediately upload that document. I'm getting 404 while it is fetching the preview. If I do the preview again after sometime It is loading fine.
When uploading immediately edited document.
Any suggestions?
Initially I thought it was due to location Im getting it even before file is completely uploaded but It was working incase I upload a document that was not edited recently so I ruled out that case.
Getting 404 while it is fetching the preview
The above error occurs
If another client deleted a container or blob before this request.
If the specified blob or resource URL does not exist may cause 404 error.
Please make sure the filename (blob name) you provided indeed exists in your container because blob name is case sensitive.
If you are accessing through private container is one possible reason and change Access level to container or blob.
I tried in my environment to fetch file from azure blob storage and got same error in postman:
Postman:
I tried with proper Url+SAS-token, I can successfully fetch files from postman.
Reference:
Azure Storage Static website error - Resource not found or content doesn't exist - Stack Overflow by Bennie van der Walt.

Autodesk Forge - problems with very large .zip files

We allow our users to upload files to forge, but to our bucket (they don't need to create their own) as we're only using the model viewer. This means they need to upload to our server first.
The upload method uses the stream from the HttpContent (we're using WebAPI2) and sends it right on into the Forge API methods.
Well, it would, but I get this exception - Error getting value from 'WriteTimeout' on 'System.Net.Http.StreamContent+ReadOnlyStream'.
This means that the Forge API is checking the Write Timeout without checking CanWrite or CanTimeout. Have I found an API bug?
Copying to another stream is feasible but I can't use a debugger to test the file our client is reporting further problems with, because it's 1.1GB and my dev box runs out of memory.

How can I set a file upload function?

I am creating an SAPUI5 WebApp with an file upload function. I try this example from SAPUi5 Explored: sap.m.sample.UploadCollection
I try with my trial account in SAP WebIDE to set the upload function ( Upload Collection)
The issue is, not allowing to upload a file in the project folder or local desktop folder.
If I upload a file it appears but i can't open it and I get a 405 HTTP
error.
Any Ideas, what the problem is?
like you see already in your posts comments, you need a backend for this task. The UploadCollection control is only usable with a backend in the background which receives the transmitted file from the control.
On the page https://sapui5.hana.ondemand.com/#/api/sap.m.UploadCollection you see
This control allows you to upload single or multiple files from your devices (desktop, tablet or phone) and attach them to the application
while you can replace "application" with "receiving backend"
Indipendent of this may I allowed to ask where do you think the file should be uploaded when not to a backend system? I mean when you choose a file from your local storage it doesn't make any sense to upload it again to your local storage?!

Error uploading file to Alfresco using Java, CmisConstraintException:Conflict

I am getting an error uploading a file to repository using Java. I am using Alfresco 4.0e. I am able to connect to the repository, located on Unix server, from my Application, developed in struts, from localhost.
I am using OpenCMIS to connect and upload. When I try to upload a document it gives an error after executing createDocument(...)
org.apache.chemistry.opencmis.commons.exceptions.cmisconstraintException:Conflict
It's possible the document already exists. Can you check the logs on the Alfresco server for detail there?

Pyramid/Pylons: How to check if an uploaded file is complete in a POST request?

I'm building a web tool which allows users to upload PDFs to a server using their web browsers. The server is based on Python (Paste + Pyramid).
The problem I have right now is the following: If a user uploads a rather large file (let's say 100 MB) and they cancel the upload before it is completed, my handler code on the server is still called (instead of the request being aborted).
The problem is that the request.POST['myfile'].file is incomplete when that happens. This effectively means that the PDF file is corrupted if I simply write it to some place on the server.
When I watch the server's log, it shows a "broken pipe" exception within the Paste server; however I have no idea how to catch that exception and have it prevent my view/handler code from executing and storing the incomplete file.
Seems like the paster HTTP server does not correctly validate the uploaded form data and simply passes the request down the WSGI pipeline even if the connection (HTTP POST) was closed by the user.
I worked around this issue by simply setting up NGINX to act as a reverse proxy. This also adds some security benefits as it might be better tested than paster.
Update:
My main problem was that I was using runserver (the built in web server of manage.py). After some trial and error we ended up using WSGI.
More specifically, uWSGI and Nginx as web server. Static content is served directly by Nginx while dynamic pages are piped through uWSGI and are handled by the Python web app.
Unless you are doing something fancy (like tracking the upload progress, etc), your pylons controller should not be invoked until the entire file has been uploaded.