Uploading Attachment to a list item

Dec 6, 2012 at 8:31 AM

Hi, I need help in adding an attachment to a list in sharepoint and later to retrive the names of the attachments when I show the list details in a form. Can anyone guide me in this please. Or any documentation that I can refer.

Coordinator
Dec 7, 2012 at 2:19 AM

Can you give some more info? Are you already in a list form? What's the context?

M.

Dec 7, 2012 at 7:11 AM

Hi,..

I have created a custom html form which acts as a front end to enter data in a list. I am showing this form using a webpart. Once user enters data in this form and clicks on save the data is getting stored in the list. But I also want user to uload some supporting documnts to the data entered. Could you please tell me how will i do that. If I create a browse button and get the file path, then whats the next step to add the attachemnt to the list record.

Coordinator
Dec 7, 2012 at 1:46 PM

Why wouldn't you use the regular list forms for this? They include the mechanics for uploading attachments, assuming the list allows it.

M.

Dec 7, 2012 at 8:09 PM

I could have, but as per my requirement, I had to customize the look n feel of the user input form. Which the default list form does not do. It only all the fields come one after another. Is there any solution for my requirement?

Coordinator
Dec 7, 2012 at 9:06 PM
Edited Dec 7, 2012 at 9:06 PM

It's still not clear what your requirement actually is. You can certainly rearrange the columns in a form page in several different ways.

M.

Dec 7, 2012 at 9:58 PM
Edited Dec 7, 2012 at 10:21 PM

My requirement is very simple. 

I have to create a sharepoint site for my team where we can store team details. I have created a list, where i am storing all data. To enter the details I have created an user form. By using updatelistitem i am saving the data entered by the user to the list. In other words, list is my database and the form I have created is my GUI to enter data. I could have used the default list form to add new item. But as per my need I needed some change in the look of the form. I have added some tool tip, some validations (using java script) as per my process.

Mainly in the regular list form all the input box comes one after one vertically, which I dont know how to rearrange. Please note I dont have Sharepoint Designer installed at my office. So I wont be able to do any customization which will require designer. IF without it the re arrangement is possible then I am not aware of the same. Will be greatful if you can help me in this too.

Regarding my requirement: Along with the details in the list, I also want to attach some document with each new item added. I will provide an option to user to upload word or excel file to add to the newly added record. Can be one resume or some reference doc. Is it possible using SPServices? Can I upload an attachment by code?

Kindly help me in this..

Also if this is not possible then it will be helpful if you can tell me how to upload some document to a document library

Coordinator
Dec 8, 2012 at 4:32 AM

The benefit of using the default list forms is that they have the attachment logic built in. I often rearrange things on the default forms simply by using script to manipulate the DOM elements and CSS. You can do this without SharePoint Designer, though it certainly is easier if you use it.

There's an Add Attachment operation in the Lists Web Services if you'd rather go that route. You'll have to build your own way for the user to browse to or otherwise identify the file.

M.