Syntax download link in google docs spreadsheet

Is there a way to make the download link instead of the browser try to open the file? In this case, I have a table of documents and some links to mp3 files. I want users to download these files, not the browser playing it. Mp3 posted on another site. Thanks Bo

+5
source share
3 answers

To download links for documents - https://docs.google.com/feeds/download/documents/Export?docID=yourDocId

To make download links for any file - https://docs.google.com/uc?id=yourDocId&export=download&hl=en_US

- https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=yourDocId&exportFormat=csv


2018 .

URL-
https://docs.google.com/spreadsheets/d/<KEY>/export?gid=<GID>&format=csv
<KEY> <GID> URL,
https://docs.google.com/spreadsheets/d/<KEY>/edit#gid=<GID>

PS: , GID - . , gid=0, , (GID ).

, wget curl, ,

   wget --no-check-certificate -O test.csv \
    'https://docs.google.com/spreadsheets/d/0At2sqNEgxTf3dEt5SXBTemZZM1gzQy1vLVFNRnludHc/export?gid=0&format=csv'
+10

Google CSV (, ). Google , :

1uFwmwD5UFLdD1DMPGT5p4fIGozfImx44DNCOeMJr1Lo

, . , .

- (NSString *) downloadGoogleSheetGivenFileID: (NSString *) ID {
// This will download a Google spreadsheet given it file ID
// and convert it to a CSV file.
NSString    *   preFix;
NSURL       *   myURL;
NSString    *   opCmd;
NSString    *   t;
NSString    *   theStuff;
NSError     *   error = nil;

theStuff = @"";
// The URL has to be: prefix+ID+opCmd  The only thing that changes is the file ID
preFix = @"https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=";
opCmd = @"&exportFormat=csv";
t = preFix;
t = [t stringByAppendingString:ID];
t = [t stringByAppendingString:opCmd];
myURL = [NSURL URLWithString:t];
theStuff = [NSString stringWithContentsOfURL:myURL encoding: NSUTF8StringEncoding error:&error];
if(error != nil)
{
    // There was an error downloading the spread sheet file.
    // We will return a zero length string.
    NSLog(@"%@",error);
}
return theStuff;

}

0
source

All Articles