RavenDb File Storage issue based on 3.0.3 version - ravendb

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?

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.

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?!

Read content of server files in pentaho

My task is to generate a report based on content in server files(ascii) in pentaho.
I could come up with job to establish connection, get required files onto disk and generate report. But I want to change the flow by getting files or file content into memory rather than onto disk.
Established connection with server with job entry 'Get a file with SFTP' and file content is injected into transformation which starts with entry 'modified javascript value' .
Could someone please help me with this ?
If the files are in an FTP, or any file system that VFS can access (see VFS Supported Systems), you can access these files through the Get File Names Transformation Step, by passing the Filename atribute directly into the input step you use (Text file or XML or any other)

Make Indexed File Downloadable In Apache Solr

I am trying to indexed pdf file to Solr which I have done successfully using the command
curl "http://localhost:8983/solr/update/extract?literal.id=id=true"-F myfile=#filename.pdf"
I am able to see the file contents and search, but when I try to click on file name it shows
HTTP ERROR 404
Problem accessing /solr/collection1/id. Reason:
not found
What I want is to have a link which allows downloading the file, I know Solr merely indexes the file and stores it. I was wondering if there is a way by which I can add attribute location like you have done and proceed from there, can you please share with me what you have done, if you want any more clarity regarding my problem do ask.
We have the actual files hosted through a separate web application to be download from with auditing and additional security.
you can always directly host these files through http server.
If you are having the file names with id, it is as easy as appending the id.extension to the fixed http hosted url.
Else index the path of the file with an additional parameter e.g. literal.url.
The url will the solr field which will now be available with the Solr response.

Uploading multiple files given only relative local path

Say I have a user, and that user has an XML file which, among other things, includes the relative (to the XML file) path to one or more images stored on their local machine. I want them to be able to upload this XML file to a web server, and automatically upload the images.
So my XML file might contain:
<tag>Images\img_20120905_015463548.jpg</tag>
and I want to upload both the XML file and img_20120905_015463548.jpg in one operation.
The problem is, as best I can tell, I can't get a local web page to grab the images automatically using JS/jQuery due to the pesky web browser security model that won't allow me to upload arbitrary files off the local computer, or even know the real path of the XML file. After bashing my head against a brick wall for a few hours, I've come up with two possible solutions:
Upload the XML file, the server strips out the image file addresses and asks the user to locate each one. While it would get the job done, it's ugly and error-prone.
Use a batch file (or similar) to copy the XML file and images to a public-facing web server that the user can access on the local network, and then supply the public address of the XML file to my web server. It can then grab the images off the local public server. Problem: my IT department are too competent to allow users file access to public-facing servers. :)
Is there any solution out there I might have missed, that allows the user to upload multiple files given filenames only specified as a relative path?
Thanks in advance. :)
If you are not restricted to a web-only solution, this would be achievable using a plugin or desktop application. For instance, a desktop .NET or Java WebStart application or a signed and therefore trusted Java applet would be able to access the local XML file and any associated image files, then upload them to the web server using a POST, web services or WebDAV.