I am trying to integrate Google-docs UI with ASP.NET Web application.
In this files are stored on our file storage and We want to open Google Docs Editor to edit the word/excel/PPT files.
As a part of POC for this requirement, I am doing below:
Uploading file into Google Drive using below code:
Dim objInsert As Google.Apis.Drive.v2.FilesResource.InsertMediaUpload = objDriveService.Files.Insert(objFile, objStream, sMimeType)
objInsert.Convert = True
objInsert.Upload()
Getting response after upload and using objFile.AlternateLink
property to open the Editor to edit file.
I am facing the issue to download the file when I am using
objInsert.Convert = True. when I am making the call to File object
my Download URL (objFile.DownloadUrl) is not returning it is set
with Null. If I don't use the objInsert.Convert = True then I
am getting Download URL but problem is then AlternateLink open the
file in View mode with various option, I want the URL to open it
directly in editor.
Please suggest what am I missing here.
UPDATE: this was already asked here: DownloadUrl missing from metadata for file on Google Drive API
I think it is the expected behaviour. You can't directly download a Google file type, you have to export it to some compatible format.
Related
I have a docx file saved on firebase and I want to render this documnent in my app so not using an external app to open the document as a number of file libraries do. I have tried flutter_filereader which works perfect for a file on my phone however i cannot use it to open a url. Is this possible? I think converting it to a pdf would work as I can display those from a url, however I cannot find a library that will allow me to convert files to pdf before uploading to firebase?
Any help is much appreciated
You could display the url in-app using flutter_webview https://pub.dev/packages/webview_flutter
You can do this with a simple API call to PdftronFlutter.openDocument
Follow the this link https://www.pdftron.com/blog/flutter/build-a-document-viewer-in-flutter/. This blog said the usage of PdftronFlutter.
I want to implement a simple meta search engine with asp.net that integrate result of 2 search engine without ranking the results of them.
I know first i should add wsdl file into vs so I downloaded wsdl file of google and it locate for example on my c: drive of my laptop but when in vs i want to add serviece refrence and i entered the path of my wsdl file vs can not fine it
I also try add web refrence,I don't know where is my problem
I attach the picture of it
enter image description here
enter image description here
please try this instead :
http://dic.googlecode.com/files/GoogleSearch.wsdl
ref : Unable to get Google API key and GoogleSearch.Wsdl which are required to run a perl script
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
Hi i have the standard file upload control in asp.net 4.5, and i limit what users can upload by checking the file extension. All works a treat but i know need to allow them to upload a zip file.
My Problem
Now i only want to allow the zip file if the files inside are of the extenions i allow {pdf, txt, doc . etc}.
I have tried the below:
Using archive As IO.Compression.ZipArchive = ZipFile.OpenRead(File.InputStream.ToString)
End Using
The above wont work becuase ZipFile.OpenRead(Needs the path of the zip folder). So how can i acces the file without having to save it to disk. Do have I have to save it to disc in a temp folder first?
Ideally as .NET 4.5 has compression i dont want to use third party tools.
Thanks
In order to read the archive file all thats needed is as below:
Using archive As New IO.Compression.ZipArchive(HttpPostedFile.InputStream)
end using
*notice the new zipArchive here takes the HttpPostedFile.inputStream. The code snippet i was using above in my question was taken from the micorosft site http://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive.aspx. Which was not working.
Thankyou #user2675751 for your comments
I am creating an excel report in vb.net using the office interop. When the report is completed I am saving the excel file on the C drive. The users have asked to save file anywhere they want not just the c drive. Can someone give me some code to popup an opend file dialog in asp.net?
I want the dialog to popup in a saveAs in ASP.NET. I know how to do it in win forms, but I am creating an excel report in asp.net and calling the worksheet objects SaveAs property that excepts a fileName. So right now I just hardcode a file name in there. The users want to choose a file location
I think what you want is actually rather simple.
You can't save a file to the user's computer due to security restrictions (would you want a website saving a file to your computer?)
What you need to do is:
Complete report
Save report file to location on server, IE (.../myWebsite/files/GUID/myReport.rpt)
Display link on next screen pointing to the report file
Doing this the user can right-click and save the file to wherever they want on their computer.
You can clean up these files on whatever schedule you would like.
Assuming you are actually talking about a desktop, winforms app then you can use the built in FileSaveDialog.
Official documentation is here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx
but there are tons of tutorials explaining it out there:
http://www.google.co.uk/search?q=vb.net+savefiledialog
You can server files with the Open / Save dialog by using Response.TransmitFile().
The user is then presented with a save as dialog where they can choose the filename and the location on their computer.
You normally do this inside a HttpHandler. A simple one is described here:
http://blogs.msdn.com/petel/archive/2005/12/01/499189.aspx