Error saving editor form after uploading files - Page 3

Error saving editor form after uploading files

13»

Answers

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3

    I will go back to using an MJOIN and try and insert the missing lines via sql. If I use an MJOIN in code in post 'October 11' as per below I still get 'Object reference not set to an instance of an object.'. What would be the cause?

                        editor.MJoin(new MJoin("AutoCDRFiles")
                            .Link("UserFiles.id", "AutoCDRFiles.UserFileID")
                            .Order("AutoCDRFiles.id ASC")
                            .Field(new Field("UserFileID")
                                .SetFormatter(Format.IfEmpty(0))
                                .Upload(new Upload(strFolder + "__NAME____EXTN__")
                                    .Db("UserFiles", "id", new Dictionary<string, object>
                                    {
                                            {"WebPath", Upload.DbType.WebPath},
                                            {"SystemPath", Upload.DbType.SystemPath},
                                            {"FileName", Upload.DbType.FileName},
                                            {"FileSize", Upload.DbType.FileSize}
                                    })
                                    .Validator(Validation.FileExtensions(CommonUtilities.CorrectFileTypes(2), lblo.lblInvalidFileType))
                                )
                            )
                        );
    
  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3

    IS there a .net example for the Custom upload action?

    https://editor.datatables.net/manual/php/upload#Custom-upload-actions

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3

    Please ignore last post. Found it.

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3
    edited October 2019

    How is the Upload.Action() used? On that page https://editor.datatables.net/manual/net/upload#Custom-upload-actions there is a mention of it then an example but this example is not using the Action method. Is there another .net example out there I can see?

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin

    This would presuppose, again, that I would have to move all the fields about the scan to that files table when that files table should only hold meta info about the file and nothing else.

    I don't get that - why? If AutoCDRFiles holds scan information, that seems fine to me. Then use a left join to link it to the files that that holds meta information about that actual file?

    I will go back to using an MJOIN and try and insert the missing lines via sql.

    I'm concerned about this method because is going to be using Editor in a way that it was not designed. I would very much not recommend this method.

    How is the Upload.Action() used?

    Its used here:

            new Upload( (file, id) => {
                file.SaveAs( request.PhysicalApplicationPath + @"uploads\" + id );
            } )
    

    when you give a function to the Upload constructor that is the action.

    Allan

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3
    edited October 2019

    "I don't get that - why? If AutoCDRFiles holds scan information, that seems fine to me. Then use a left join to link it to the files that that holds meta information about that actual file?"

    If AutoCDRFiles holds a single row per create and UserFiles holds all the file meta data, one file per row, I fail to see how AutoCDRFiles can hold scan data for each row/file in UserFiles table or am I missing something still?

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin

    I promise I'm trying to understand here - not being deliberately obtuse! You obviously have a much better understanding of your system, so there are parts I'm missing which I suspect is confusing us both.

    Can you demonstrate what data you expect the end user to enter in the form, and what information (and where) you want to store it in the db?

    Allan

  • dynasoftdynasoft Posts: 422Questions: 67Answers: 3

    Please see pdf sent by email. It has everything.

This discussion has been closed.