Using mechanize to upload files to Sharepoint is failing, I can't figure out why

时间:2015-07-28 16:49:46

标签: python sharepoint mechanize

Below is the code that I am using. Can anybody please tell me what I am missing here?

br.select_form("aspnetForm")
br.form.set_all_readonly(False)
FILENAME="2BProcessed.txt"
#br['ctl00$PlaceHolderMain$UploadDocumentSection$ctl03$InputFile']=FILENAME
br.form.add_file(open(FILENAME), 'text/plain', FILENAME)

print br.form
print "------------------------------------------------"
br.method="POST"
response = br.submit()
#print response.read()
for f in br.forms():
    print f

and here is what the forms look like before (empty), when a file is selected, and finally after submiting the form

Form before posting

<aspnetForm POST httP://server.addrees.removed... multipart/form-data
  <HiddenControl(MSOWebPartPage_PostbackSource=) (readonly)>
  <HiddenControl(MSOTlPn_SelectedWpId=) (readonly)>
  <HiddenControl(MSOTlPn_View=0) (readonly)>
  <HiddenControl(MSOTlPn_ShowSettings=False) (readonly)>
  <HiddenControl(MSOGallery_SelectedLibrary=) (readonly)>
  <HiddenControl(MSOGallery_FilterString=) (readonly)>
  <HiddenControl(MSOTlPn_Button=none) (readonly)>
  <HiddenControl(MSOSPWebPartManager_DisplayModeName=Browse) (readonly)>
  <HiddenControl(MSOSPWebPartManager_ExitingDesignMode=false) (readonly)>
  <HiddenControl(__EVENTTARGET=) (readonly)>
  <HiddenControl(__EVENTARGUMENT=) (readonly)>
  <HiddenControl(MSOWebPartPage_Shared=) (readonly)>
  <HiddenControl(MSOLayout_LayoutChanges=) (readonly)>
  <HiddenControl(MSOLayout_InDesignMode=) (readonly)>
  <HiddenControl(MSOSPWebPartManager_OldDisplayModeName=Browse) (readonly)>
  <HiddenControl(MSOSPWebPartManager_StartWebPartEditingName=false) (readonly)>
  <HiddenControl(MSOSPWebPartManager_EndWebPartEditing=false) (readonly)>
  <HiddenControl(_maintainWorkspaceScrollPosition=0) (readonly)>
  <HiddenControl(__REQUESTDIGEST=0x86FE3811F793DC67C1CA3282A8213erwerC0CD91108B06F41D5C600B09C3A22E0661289A176933917B7D6786859B7717A924AE49E31E5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jDQLHnuf8DwLI6ZCjDAC/5mtuxuY2gn08bbL4JgmPox8f) (readonly)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl00=https://server.address.removed/wnp0/04693Ka00000878) (readonly)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl01=https://server.address.removed/wnp0/04693Ka00000878/Shared Documents) (readonly)>
  <TextControl(ctl00$PlaceHolderSearchArea$ctl01$S3031AEBB_InputKeywords=Search this site...)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl05=0) (readonly)>
  <HiddenControl(destination=/wnp0/04693Ka00000878/Shared Documents/Data) (readonly)>
  <FileControl(ctl00$PlaceHolderMain$UploadDocumentSection$ctl03$InputFile=<No files added>)>
  <CheckboxControl(ctl00$PlaceHolderMain$UploadDocumentSection$ctl03$OverwriteSingle=[*on])>
  <TextControl(ctl00$PlaceHolderMain$ctl04$ctl02$uploadLocation=/Data/)>
  <SubmitControl(ctl00$PlaceHolderMain$ctl04$ctl02$selectTargetButton=Choose Folder...) (readonly)>
  <IgnoreControl(ctl00$PlaceHolderMain$ctl03$RptControls$btnOK=<None>)>
  <IgnoreControl(ctl00$PlaceHolderMain$ctl03$BtnCancel=<None>)>
  <TextControl(__spText1=)>
  <TextControl(__spText2=)>>

Forme before submitting it:

<aspnetForm POST httP://server.addrees.removed04693Ka00000878 ...multipart/form-data
  <HiddenControl(MSOWebPartPage_PostbackSource=)>
  <HiddenControl(MSOTlPn_SelectedWpId=)>
  <HiddenControl(MSOTlPn_View=0)>
  <HiddenControl(MSOTlPn_ShowSettings=False)>
  <HiddenControl(MSOGallery_SelectedLibrary=)>
  <HiddenControl(MSOGallery_FilterString=)>
  <HiddenControl(MSOTlPn_Button=none)>
  <HiddenControl(MSOSPWebPartManager_DisplayModeName=Browse)>
  <HiddenControl(MSOSPWebPartManager_ExitingDesignMode=false)>
  <HiddenControl(__EVENTTARGET=)>
  <HiddenControl(__EVENTARGUMENT=)>
  <HiddenControl(MSOWebPartPage_Shared=)>
  <HiddenControl(MSOLayout_LayoutChanges=)>
  <HiddenControl(MSOLayout_InDesignMode=)>
  <HiddenControl(MSOSPWebPartManager_OldDisplayModeName=Browse)>
  <HiddenControl(MSOSPWebPartManager_StartWebPartEditingName=false)>
  <HiddenControl(MSOSPWebPartManager_EndWebPartEditing=false)>
  <HiddenControl(_maintainWorkspaceScrollPosition=0)>
  <HiddenControl(__REQUESTDIGEST=0x86FE3811F793DC67C1CA3282A4324325BE6BACC0CD91108B06F41D5C600B09C3A22E0661289A176933917B7D6786859B7717A924AE49E31E5C4B9A01DD25A2EC2,28 Jul 2015 15:52:24 -0000)>
  <HiddenControl(__VIEWSTATE=/wEPDwUJMzMyMzUzNDEyD2QWAmYPZBYCAgrweertAgMPFgIeB2VuY3R5cGUFE211bHRpcGFydC9mb3JtLWRhdGEWCgIRD2QWBGYPZBYEAgEPZBYCZg9kFgQCAg9kFhICAQ8WAh4HVmlzaWJsZWhkAgMPFggeE0NsaWVudE9uQ2xpY2tTY3JpcHQFigFqYXZhU2NyaXB0OkNvcmVJbnZva2UoJ1Rha2VPZmZsaW5lVG9DbGllbnRSZWFsJywxLCAxLCAnaHR0cHM6XHUwMDJmXHUwMDJmc3B4Z3JvdXAucmJjLmNvbVx1MDAyZnducDBcdTAwMmYwNDY5M0thMDAwMDA4NzgnLCAtMSwgLTEsICcnLCAnJykeGENsaWVudE9uQ2xpY2tOYXZpZ2F0ZVVybGQeKENsaWVudE9uQ2xpY2tTY3JpcHRDb250YWluaW5nUHJlZml4ZWRVcmxkHgxIaWRkZW5TY3JpcHQFIVRha2VPZmZsaW5lRGlzYWJsZWQoMSwgMSwgLTEsIC0xKWQCBw8WAh8BaGQCCQ8WAh8BaGQCCw8WAh8BaGQCDw8WAh8BaGQCEQ8WAh8BaGQCEw8WAh8BaGQCFQ8WAh8BaGQCAw8PFgoeCUFjY2Vzc0tleQUBLx4PQXJyb3dJbWFnZVdpZHRoAgUeEEFycm93SW1hZ2VIZWl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jZUhvbGRlck1haW4kVXBsb2FkRG9jdW1lbnRTZWN0aW9uJGN0bDAzJE92ZXJ3cml0ZVNpbmdsZQVHY3RsMDAkUGxhY2VIb2xkZXJUb3BOYXZCYXIkUGxhY2VIb2xkZXJIb3Jpem9udGFsTmF2JFRvcE5hdmlnYXRpb25NZW51VjQPD2QFBEhvbWVkOhC8IAD1XERhAgYCUaHvvTQe4BY=)>
  <HiddenControl(__EVENTVALIDATION=/wEWCgLi07HcCgKpn5bCCwLEiLTXBQLNrvertyCDQKMpf/RBQL7opj3BAKLy4KjDQLHnuf8DwLI6ZCjDAC/5mtuxuY2gn08bbL4JgmPox8f)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl00=https://server.address.removed/wnp0/04693Ka00000878)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl01=https://server.address.removed/wnp0/04693Ka00000878/Shared Documents)>
  <TextControl(ctl00$PlaceHolderSearchArea$ctl01$S3031AEBB_InputKeywords=Search this site...)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl05=0)>
  <HiddenControl(destination=/wnp0/04693Ka00000878/Shared Documents/Data)>
  <FileControl(ctl00$PlaceHolderMain$UploadDocumentSection$ctl03$InputFile=2BProcessed.txt)>
  <CheckboxControl(ctl00$PlaceHolderMain$UploadDocumentSection$ctl03$OverwriteSingle=[*on])>
  <TextControl(ctl00$PlaceHolderMain$ctl04$ctl02$uploadLocation=/Data/)>
  <SubmitControl(ctl00$PlaceHolderMain$ctl04$ctl02$selectTargetButton=Choose Folder...)>
  <IgnoreControl(ctl00$PlaceHolderMain$ctl03$RptControls$btnOK=<None>)>
  <IgnoreControl(ctl00$PlaceHolderMain$ctl03$BtnCancel=<None>)>
  <TextControl(__spText1=)>
  <TextControl(__spText2=)>>

  -------------Form after  using .submit() -----------------------------------

<aspnetForm POSThttP://server.addrees.removed04693Ka00000878/_layouts/UploadEx.aspx?List=%7bDAD046C2-93DB-47E9-85D1-B37BA16BC0F0%7d&RootFolder=%2fwnp0%2f04693Ka00000878%2fShared+Documents%2fWiFi+Installation+Data multipart/form-data
  <HiddenControl(MSOWebPartPage_PostbackSource=) (readonly)>
  <HiddenControl(MSOTlPn_SelectedWpId=) (readonly)>
  <HiddenControl(MSOTlPn_View=0) (readonly)>
  <HiddenControl(MSOTlPn_ShowSettings=False) (readonly)>
  <HiddenControl(MSOGallery_SelectedLibrary=) (readonly)>
  <HiddenControl(MSOGallery_FilterString=) (readonly)>
  <HiddenControl(MSOTlPn_Button=none) (readonly)>
  <HiddenControl(MSOSPWebPartManager_DisplayModeName=Browse) (readonly)>
  <HiddenControl(MSOSPWebPartManager_ExitingDesignMode=false) (readonly)>
  <HiddenControl(__EVENTTARGET=) (readonly)>
  <HiddenControl(__EVENTARGUMENT=) (readonly)>
  <HiddenControl(MSOWebPartPage_Shared=) (readonly)>
  <HiddenControl(MSOLayout_LayoutChanges=) (readonly)>
  <HiddenControl(MSOLayout_InDesignMode=) (readonly)>
  <HiddenControl(MSOSPWebPartManager_OldDisplayModeName=Browse) (readonly)>
  <HiddenControl(MSOSPWebPartManager_StartWebPartEditingName=false) (readonly)>
  <HiddenControl(MSOSPWebPartManager_EndWebPartEditing=false) (readonly)>
  <HiddenControl(_maintainWorkspaceScrollPosition=0) (readonly)>
  <HiddenControl(__REQUESTDIGEST=0x86FE3811F793DC67C1CA3282A84C015BE6BACC0CD91108B06F41D5C600B09C3A22E0661289A176933917B7D6786859B7717A924AE49E31E5C4B9A01DD25A2EC2,28 Jul 2015 15:52:24 -0000) (readonly)>
  <HiddenControl(__VIEWSTATE=/wEPDwUJMzMyMzUzNDEyD2QWAmYPZBYCAgEPZBYCAgMPFgIeB2VuY3R5cGUFE211bHRpcGFydC9mb3JtLWRhdGEWCgIRD2QWBGYPZBYEAgEPZBYCZg9kFgQCAg9kFhICAQ8WAh4HVmlzaWJsZWhkAgMPFggeE0NsaWVudE9uQ2xpY2tTY3JpcHQFigFqYXZhU2NyaXB0OkNvc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gJmDw8WAh8MBQdGb2xkZXI6ZGQCAg8WAh8BaGQCAw9kFgZmD2QWAmYPDxYCHwxlZGQCAQ9kFgICAQ8PFgIfDAUYL1dpRmkgSW5zdGFsbGF0aW9uIERhdGEvZGQCAg8WAh8BaGQCAg8PFgIfAWhkZAIHD2QWAgIBD2QWAmYPFgQeCWFjY2Vzc2tleQUBQx4Hb25jbGljawXhAXdpbmRvdy5sb2NhdGlvbj0nXHUwMDJmd25wMFx1MDAyZjA0NjkzS2EwMDAwMDg3OFx1MDAyZlNoYXJlZCBEb2N1bWVudHNcdTAwMmZGb3Jtc1x1MDAyZkFsbEl0ZW1zMS5hc3B4P1Jvb3RGb2xkZXI9XHUwMDI1MkZ3bnAwXHUwMDI1MkYwNDY5M0thMDAwMDA4NzhcdTAwMjUyRlNoYXJlZFx1MDAyNTIwRG9jdW1lbnRzXHUwMDI1MkZXaUZpXHUwMDI1MjBJbnN0YWxsYXRpb25cdTAwMjUyMERhdGEnIGQYAgUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFQWN0bDAwJFBsYWNlSG9sZGVyTWFpbiRVcGxvYWREb2N1bWVudFNlY3Rpb24kY3RsMDMkT3ZlcndyaXRlU2luZ2xlBUdjdGwwMCRQbGFjZUhvbGRlclRvcE5hdkJhciRQbGFjZUhvbGRlckhvcml6b250YWxOYXYkVG9wTmF2aWdhdGlvbk1lbnVWNA8PZAUESG9tZWRzdhFBs3mk/C4sRCsvYb44ydiL+Q==) (readonly)>
  <HiddenControl(__EVENTVALIDATION=/wEWCgKctKHNAgKpn5bCCwLEiLTXBQLNrvW5AwLY47yCDQKMpf/RBQL7opj3BAKLy4KjDQLHnuf8DwLI6ZCjDLQQtRpJaA+c51Db8+nAhd28gOn9) (readonly)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl00=https://server.address.removed/wnp0/04693Ka00000878) (readonly)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl01=https://server.address.removed/wnp0/04693Ka00000878/Shared Documents) (readonly)>
  <TextControl(ctl00$PlaceHolderSearchArea$ctl01$S3031AEBB_InputKeywords=Search this site...)>
  <HiddenControl(ctl00$PlaceHolderSearchArea$ctl01$ctl05=0) (readonly)>
  <HiddenControl(destination=/wnp0/04693Ka00000878/Shared Documents/Data) (readonly)>
  <FileControl(ctl00$PlaceHolderMain$UploadDocumentSection$ctl03$InputFile=<No files added>)>
  <CheckboxControl(ctl00$PlaceHolderMain$UploadDocumentSection$ctl03$OverwriteSingle=[*on])>
  <TextControl(ctl00$PlaceHolderMain$ctl04$ctl02$uploadLocation=/Data/)>
  <SubmitControl(ctl00$PlaceHolderMain$ctl04$ctl02$selectTargetButton=Choose Folder...) (readonly)>
  <IgnoreControl(ctl00$PlaceHolderMain$ctl03$RptControls$btnOK=<None>)>
  <IgnoreControl(ctl00$PlaceHolderMain$ctl03$BtnCancel=<None>)>
  <TextControl(__spText1=)>
  <TextControl(__spText2=)>>

1 个答案:

答案 0 :(得分:-1)

亲爱的朋友,您可能忘记在将文件提交到列表后更新命令。您的机械化非常完美,只需在发布后提交更新命令即可。 之后:response = br.submit()