Upload a file from a 'select' field
Hi, I have added one option on the 'Upload File (version 1.1.3)' page. The idea is to upload a file which is selected in this select field. I have added this to upload.xml: <param name="openBISDataSet" type="select" label="Files" help="select Files" dynamic_options="getURL()" > This works fine and I get the select field dynamically filled by an extra python script with the correct files. This script has a method called 'getURL()'. This returns a python list and I see the values are all correct in there when doing a print of this list with the use_printdebug = True: Log messages [[u'original/Seq_dir/some_file.txt', u'https://bs-openbis11.ethz.ch:8444/datastore_server/stream-content?streamI D=120810112558484-F1D4A3429AECDE24F8C8A6EABDD1E7DD', False], [u'original/Seq_dir/my_file.fastq.gz', u'https://bs-openbis11.ethz.ch:8444/datastore_server/stream-content?streamI D=120810112600832-126422C985537A9969C466878D453546', False]] One strange thing is that it is printed twice, which means it is called twice. I have no clue why. But how do I make the upload finally working? I always get an error message when hitting the Execute button (cf. screen shot). Any hints would be helpful. Just for completeness the "getURL()" function: <snip> def getURL(): sessionToken = login() fList = [] filePathList = [] files = dssServer.listFilesForDataSet(sessionToken, '20120807164613048-4184', '/', True) for file in files: if not file['isDirectory']: filePathList.append(file['pathInDataSet']) for file in filePathList: streamURL = dssServer.getDownloadUrlForFileForDataSet(sessionToken, '20120807164613048-4184', file) fList.append([file,streamURL, False]) print fList return fList </snip> Cheers Manuel -- Manuel Kohler Center for Information Sciences and Databases (C-ISD) Department of Biosystems Science & Engineering (D-BSSE) ETH Zurich, Maulbeerstrasse (1078, 1.02), CH-4058 Basel, +41 61 387 3132
participants (1)
-
Kohler Manuel