Extensis Logo SUPPORT | FORUMS | KNOWLEDGE BASE

Written permission error


#1

We are trying to write custom field attributes to a catalog created in Portfolio through Portfolio API. However, we got a written permission error. The code we are using as below:

Portfolio Version: 2.1.2

C#:

service.updateAssetFieldValues(sessionId, catalogId, aq, changesList.ToArray(), false);

We got an error:

“cannot write to file \peny7fnp1\Designer\ARGENTINA\1FSJ0093_425.tif”

Can anyone help us to resolve the issue?


#2

Hi,

You will see that error if Portfolio Server cannot write to the file when it tries to embed the new field data.

This is likely because the file’s permissions do not allow Portfolio to write to the file. Check the file’s permissions in Explorer and make sure Portfolio has permission to write and modify the file.

Note that the field value may still have been updated in Portfolio’s database. You should be able to confirm this by looking at the asset’s field value in the client.

Hope that helps, and let us know if you have any follow-up questions or concerns.

Thanks,
-Loren


#3

Hi Loren, Thanks for your relpy!

For our case, we do not want make any modification to the original image files, but store the custom field values into Portfolio database only. The reason for this is that our image shared folders scattered globally. Currently we only granted Portfolio Apps the read-only permission to view all of images in all of shared folders. In order for us to grant written permission to Portfolio Apps, we have to keep track of all of those folders. From security wise, we hardly convince the top management to agree this.

In our code, we have put “embedChangesInOriginal” to false, which I expected not to write back the meta data of custom field values back to original files.

Please help us with better solution.

Thanks,
James Gu
james.gu@pery.com


#4

Hi James,

OK, I understand that you want to just update the Portfolio database and not embed anything into the files. You should be able to do this by setting embedChangesInOriginal, so it looks like you are doing everything correctly, and I am not sure why that’s not working for you. I’ll look into this further and report back to you tomorrow or Friday at the latest.

In the mean time, feel free to send us any example code and we can look at that too.

More soon,
-Loren


#5

Hi Loren,

Our code is as below, please not we have set [color=#FF0000]embedChangesInOriginal to false[/color].

Thanks,
James Gu

    public void UpdateField(string ITEM_ID,string catalogId)
    {
        assetQuery aq = new assetQuery();
        assetQueryTerm qt = new assetQueryTerm();
        qt.fieldName = "Filename";
        qt.values = new string[] { "tesss1" };
        qt.@operator = queryOperator.equalValue;
        
        aq.queryTerm = qt;

        String descValue = "RED";
        List<String> fValues = new List<string>();
        fValues.Add(descValue);

        fieldValuesChange change = new fieldValuesChange();
        change.fieldName = "Color";
        change.action = fieldValuesChangeAction.replaceAllValues;
        change.actionSpecified = true;
        change.newValues = fValues.ToArray();

        List<fieldValuesChange> changesList = new List<fieldValuesChange>();
        changesList.Add(change);

        service.updateAssetFieldValues(sessionId, catalogId, aq, changesList.ToArray(), false);
    }

    public void UpdateFieldByFilename(string filename, List<fieldValuesChange> changesList, string catalogId)
    {
        assetQuery aq = new assetQuery();
        assetQueryTerm qt = new assetQueryTerm();
        qt.fieldName = "Filename";
        qt.values = new string[] { filename };
        qt.@operator = queryOperator.startsWithValue;

        aq.queryTerm = qt;

        service.updateAssetFieldValues(sessionId, catalogId, aq, changesList.ToArray(), false);
    }

#6

Hi James,

We looked into your problem more closely. We verified that the embedChangesInOriginal option is working correctly in the product, and it looks like your code is fine. So unfortunately we don’t have a solution for you yet.

We’ll continue investigating on Monday, and I’m confident we will get this problem solved!

Thanks,
-Loren


#7

For those of you coming to this thread in the future, James was able to help us resolve this issue. It was a bug in Portfolio 2.1.X where updating field values via the API always tried to embed, even when specifying not to embed. This issue has been resolved in 2.5.X.

Thanks to James for helping us track this down!
-Loren