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

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.

Related

Asp.net core file download corrupt

I've been trying to provide an epub download in various ways. All of them work when downloading on my laptop with any browser, but when downloading with the e-reader it results in either a "file is corrupt" or "content type not supported". The problem is not with the file itself: When I upload it to any other place (e.g. public file dump websites) I can download the file without any issues to my e-reader.
Here's one of the many ways I've tried:
IFileProvider provider = new PhysicalFileProvider(path);
IFileInfo fileInfo = provider.GetFileInfo(filename);
var readStream = fileInfo.CreateReadStream();
var fileType = "application/epub+zip"; //MediaTypeNames.Application.Octet
return File(readStream, fileType, Path.GetFileName(outputFilepath));
and on the razor page e.g.:
Epub2
Epub2
(here the first link results in "corrupt file" and the second in "content type not supported).
On the server, the file is placed outside the website root.
What are some possible reasons that the direct download to my e-reader doesn't work with this code, yet with plain file uploads/downloads it works?
Thanks a lot for your help!
The issue was the download over https to my Tolino e-reader. This specific old Tolino model has issues with downloads over https, when I switched to http I could successfully download the ebook.

CKAN resource file upload by 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?

RavenDb File Storage issue based on 3.0.3 version

We have a critical file storage issue of RavenDb.
The context is we have a Web application server and a separate File service server based on RavenDB. The user tries to upload a file with the name of "xxx_Living #Mapping.pdf" for example. The web application would then send the request to File server by wrapping the file content into the request body, passing the encoded file name as parameter with Put Action. But all the characters after and includes the '#' was blocked upon request received by File Server for unknown network reason, result in "xxx_Living". The file server is able to create file by calling filesStore.AsyncFilesCommands.UploadAsync(fileName, Request.Body) without exception.
The issue is we are able to view the File uploaded from Raven.Studio by sending a request /RavenDbServer/fs/ClientFile/search?query=__directoryName%3A%2Fclientattachments+AND+__level%3A2&start=108&pageSize=27. (see the snapshot attached)
enter image description here
But, We are not able to see the metadata by selecting the target file in the list by sending request /RavenDbServer/studio/index.html#filesystems/edit?&id=clientattachments%2F0aecef9c-6dd0-4a9e-9df3-039228576471_Living%20&filesystem=clientFile. (see the snapshot attached)
enter image description here
We also checked the network flow. the request RavenDbServer/fs/clientFile/files/clientattachments%2F0aecef9c-6dd0-4a9e-9df3-039228576471_Living%20 returns 404 code.
My question is:
1) Are those kind of files stored successfully in RavenDb File server since we can see the id, file size and Last Modify date in List page, but not able to get it by click into the file from RavenDb studio or download it by calling api filesStore.AsyncFilesCommands.DownloadAsync(FileName)?
2) Can we store the file to Raven file server with the file name contains special characters, like '#', or any other ones?

static site hosting on S3 - 404 errors on files that show in S3 management console

I'm hosting a site using S3. Until recently, no problems. Last week, I uploaded some new .html files, and all of these new files result in a 404 error, while older .html files load with no problems.
I can see the new files in the S3 bucket using the web interface. When I compare permissions and any other settings for the new vs. old files, I'm not able to see any difference. When I view the properties of a new file, the provided link works (none of my images or CSS loads, however). Also, I can get the file to load using the bucket's endpoint. But, when using our custom domain name, all new files fail to load, with the following error:
404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: test1/s3a-debug.html
RequestId: 2573FF0356xxxxxxxxxx
HostId: qYnv8alWnV/xxxxxxxxx/xxxxxxxxxxxx+NPkHLO8arfTVizUds=
I'm at a loss to explain why recently uploaded files throw a 404, and yet older files that look identical load just fine. I've seen other people report similar problems, but I've yet to find a thread with a solution.
any help would be greatly appreciated. Thanks!
Go to S3 bucket properties -> Static web hosting and add index.html as Error document.
It considers everything as directory once you append something to host URL. Now after adding index.html as Error document, when it doesn't find the required path as a folder, it will go to index.html and redirect your request.

Get metadata of file present on dropbox before downloading in iphone

I am using Dropbox Api to display the list of files and folders present on it.. User can download file and view it..
I am downloading file every time .. but now i want to download file only if it is modified..
I can get date when file was updated in its metadata LastModifiedDate..
I have displayed all files in tableview and at the time of display all files i am getting metadata of all files in following function i have mentioned. And if after displaying all list any file get change I will not get latest file..I am getting the latest LastModifiedDate after file gets download..
Following method gets called when file download is complete:
- restClient:loadedMetadata:
Is there any way by which i can get it before it starts downloading? Is there any method of dropbox api which gives metadata of file before download?
If anybody wants further explanation then please let me know..
Thanks :)
Caching policies should be your friends, as far as the server is configured to support ETag.
wiki
short guide