• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: URL Access Scripting -Upload
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URL Access Scripting -Upload


  • Subject: Re: URL Access Scripting -Upload
  • From: Emmanuel <email@hidden>
  • Date: Wed, 21 Feb 2007 15:12:16 +0100

At 3:06 PM -0500 2/20/07, Steven Valenti wrote:
I want to be able to upload a pdf file to our server, however my script can't get pass the authentication. I can mount this server to my desktop using my credentials. I have tried putting my username and password in the URL and still I get an authentication error. Shouldn't this code work? We are using Mac OS 10.4.7 and Sharepoint Portal Server , IIS 6, and Windows Server 2003. Sharepoint uses WebDAV.

set myurl to "http://archive.domain.com/TestMac2/";
set PathToPdf to (((path to desktop) as string) & "MP308233-P.pdf")
tell application "URL Access Scripting"
activate
upload file PathToPdf to myurl with authentication
quit
end tell

This code shouldn't work. http is a pull-only protocol - you can't write with http. You should have a ftp access and a ftp URL, probably archive.domain.com provided you with one. Something like:


ftp://user:password@ftp://host/directory/file

That said, if you are to upload files more than once in a year, you really should use curl, it's way more reliable. Check the archives of the list about that. Here is an excerpt from some working code from mine:

set theRemotePath to "ftp://userid:email@hidden/some path/to some file"
set theXPath to quoted form of POSIX path of theLocalPath
set res to (do shell script "curl -T " & theXPath & " " & theRemotePath & " -w '%{size_upload} bytes at %{speed_upload} bytes/s'")


The complicated end of the curl command is to get some stats as the result of the command - it's optional of course.

Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: URL Access Scripting -Upload
      • From: Jakob Peterhänsel <email@hidden>
References: 
 >URL Access Scripting -Upload (From: Steven Valenti <email@hidden>)

  • Prev by Date: How to script Photoshop CS2 to make a smart object out of a layer selected?
  • Next by Date: Re: URL Access Scripting -Upload
  • Previous by thread: Re: URL Access Scripting -Upload
  • Next by thread: Re: URL Access Scripting -Upload
  • Index(es):
    • Date
    • Thread