I am trying to access pdf using public url uploaded on cloudinary however url request has been successfully completed but nothing showed.
Permission : Blocked for delivery shows in properties of pdf on cloudinary
Based on a recent update to our security policies, we've restricted delivery on newly created Free accounts for PDFs and Archive files. Such files can still be uploaded, but the restriction is specifically on delivery.
For PDFs that are uploaded with resource_type - "image", as they support transformations, they can be converted to images and will be delivered - e.g. by using the page transformation (pg_ in URLs) and setting the extension to jpg. -
in javascript we just need to replace extension to .jpg
response?.data?.url.replace(".pdf", ".jpg")
source
If you are on a free plan and need to deliver files in these formats, you can navigate to the Security tab of Settings in the Management Console and select to 'Allow delivery of PDF and ZIP files' or find it at the bottom.
Related
I've used hours to find out how to upload external pdf (or any other files) from url to server (for example to public folder like /public/uploads). I found tons of examples how to upload it from form, but not from the external url.
Lets say that I have this url https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
and I like to upload it to /public/uploads
Is there any directions or examples available?
I have a drupal site and an oneDrive for business account. My site has a software section through which we provide software to download for public. What we use to do is that we upload the software in our ODFB account, create a download link, then put the link after the description of the software.
What I wanted to do is that while posting the software, there should be an option to upload the software. And the file should go straight to our ODFB account instead of the server where the website is hosted.
Is it possible? Any module available?
This should be possible using the OneDrive upload APIs. If the file size is less than 100MB, you should be able to use the simple item upload API:
https://dev.onedrive.com/items/upload_put.htm
However, if the file is larger, you can use resumable item upload API:
https://dev.onedrive.com/items/upload_large_files.htm
With the right permissions, you can access your OneDrive for Business using /drives endpoint and save the file there.
I am working on a download management system in asp.net and I can upload and download a docx file. I want to view the uploaded file. I tried using google API but looks like I have to upload the file in google drive itself in order to be able to view it from google drive. I don't want to upload the file in google drive. Is there any other API that helps me to just view the uploaded docx file?
It would be even better if it can be viewed as well!
Use an iframe to embed File.embedLink, documented on
https://developers.google.com/drive/v2/reference/files#resource
I assume you know how to upload files in ASP.net
Using Office Web Apps you can achieve that, provide like of your uploaded document on your site, when the user clicks it will open in the browser it self Link, Read the documentation
Here is the link for API Site
Here's what I would like to accomplish:
I have a file stored in Windows Azure Blob Storage (or for that matter any file which is not on my web server but accessible via a URL).
I want to force download a file without actually downloading the file on my web server first i.e. browser should automatically fetch the file from this external URL and prompts the user to download it.
Possible Solutions Explored:
Here's what I have explored so far (and why they won't work):
Using something like FileContentResult as described here Returning a file to View/Download in ASP.NET MVC to download the file. This solution would require me to fetch the contents on my server and then stream from my server to the browser. For this reason this solution won't work.
Using HTML 5 download attribute: HTML 5 download attribute would have worked perfectly fine however the problem is that while it is really a very neat solution, it is not supported in all browsers.
Changing the file's content type: Another thing I could do (at least for the files that I own) to change the content type property of the file to something that the browser wouldn't understand and thus would be forced to download the file. This might work in some browsers however not in all as IE is smart enough to go beyond the content type and sees the file's content to determine the content type. Furthermore if I don't own the files, then I won't have access to changing the content type of the file.
Simply put, in my controller action I should be able to specify the URL of the file and somehow browser should force download the file.
Is this something which can be accomplished? If yes, then any ideas how I could accomplish this?
Simply put, in my controller action I should be able to specify the URL of the file and somehow browser should force download the file [without exposing the URL of the file to the client].
You can't. If the final URL is to remain hidden, your server must serve the data, so your server must download the file from the URL.
Your client can't download a file it can't get the URL to.
You can create file transfer WCF service (REST) which will stream your content from blob storage or from other sources through your file managers to client browser directly by URL.
https://{service}/FileTransfer/DownloadFile/{id, synonym, filename etc}
Blob path won't be exposed, web application will be free from file transfer issues.
I need very advanced and effective method of Preventing Users from Downloading file from website directly in asp.net.
Method should -
limit downloads,
limit time,
limit requests,
etc.
but should be downloadable by active login users
Delete the file from the server.
Any user trying to download it will not longer succeed.
You can put your files into a directory and configure that directory as not accessible by public users.
Store the files in a folder which is not accessible via IIS (i.e., not underneath your web application's root)
Create an .ashx generic handler which takes a file identifier (either filename, or ID of some sort) as a QueryString parameter.
In that .ashx, perform whatever checks you want to perform: is the user logged in? have they downloaded too many files? etc.
Then, if you decide that they should be allowed to download it, set the response headers appropriately and write the file out to Response.OutputStream