diff --git a/blobserver/go/upload-file.pl b/blobserver/go/upload-file.pl new file mode 100755 index 000000000..cd0205a74 --- /dev/null +++ b/blobserver/go/upload-file.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl +# +# Lame upload script for development testing only. Doesn't do the +# preupload step and hard-codes the Go server's upload path (not +# conformant to spec). + +use strict; +my $file = shift or die + "Usage: upload-file.pl: "; +-r $file or die "$file isn't readable."; +-f $file or die "$file isn't a file."; + +die "bogus filename" if $file =~ /[ <>&\!]/; + +my $sha1 = `sha1sum $file`; +chomp $sha1; +$sha1 =~ s/\s.+//; + +system("curl", "-u", "foo:foo", "-F", "sha1-$sha1=\@$file", + "http://127.0.0.1:3179/camli/upload") and die "upload failed."; +print "Uploaded http://127.0.0.1:3179/camli/sha1-$sha1\n"; diff --git a/blobserver/go/upload.sh b/blobserver/go/upload.sh deleted file mode 100755 index 96523a8f3..000000000 --- a/blobserver/go/upload.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -curl -u foo:foo -F sha1-7c63f74bbe0b1de55ec41ad0d9297a3762ecfdbc=@/bin/true http://127.0.0.1:3179/camli/upload -