tag:blogger.com,1999:blog-6241523649263677429.post7178353929916768995..comments2023-04-09T04:51:01.351-04:00Comments on Disha Shah's Blog: How to attach/delete/upload files to SharePoint List Item using Object
ModelDisha shahhttp://www.blogger.com/profile/02518044206110358922noreply@blogger.comBlogger64125tag:blogger.com,1999:blog-6241523649263677429.post-74359071704235879452014-03-10T08:18:21.917-04:002014-03-10T08:18:21.917-04:00Hello Disha - I am fairly new to SharePoint and wa...Hello Disha - I am fairly new to SharePoint and want to know as to how can I get a multiple upload attachment control with delete functionality in a custom site page. Can this be done using the CSOM.Anonymoushttps://www.blogger.com/profile/17600197705995553200noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-69688849154880124072012-10-31T12:21:52.086-04:002012-10-31T12:21:52.086-04:00Hi Vidya
Could you please tell me which error you...Hi Vidya<br /><br />Could you please tell me which error you are getting so I could help you out?Because above code works very well.<br /><br />Thanks<br />Disha Shah<br />Disha shahhttps://www.blogger.com/profile/02518044206110358922noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-29322390090965873002012-10-31T04:38:52.323-04:002012-10-31T04:38:52.323-04:00Hi Disha,I am having scenario where i need t uploa...Hi Disha,I am having scenario where i need t upload documents and delete documents from Share Point list.I tried out the above code but it is not working out to me.Can u plz help me to achieve my functionality like uploading documents and deleting documents.<br />Anonymoushttps://www.blogger.com/profile/13602522752555820670noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-88440841659477091602012-10-01T09:47:26.516-04:002012-10-01T09:47:26.516-04:00Hi Abdul
You just want to give reference or attac...Hi Abdul<br /><br />You just want to give reference or attachment of document which is already uploaded inside the Document Library?<br /><br />1. Attachment: Custom lists has already attachment option.<br />2. Document Library: <br /> Question: Is document library inside the same site?<br /><br />Respond with the which option you want to go with how it should work?I will reply you in more detail.<br /><br />Thanks<br />Disha Shah<br /><br /><br />Disha shahhttps://www.blogger.com/profile/02518044206110358922noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-86909272055260664382012-09-27T05:14:57.389-04:002012-09-27T05:14:57.389-04:00Hi Disha,I m new to sharepoint development. I need...Hi Disha,I m new to sharepoint development. I need help from u. I want to create a sharepoint list with custom attchment option. e.g. I want to add a row like name, designation, phone, attachment(here i want to attach a doc file but file will be located into my created document library). <br />/JilaniAnonymoushttps://www.blogger.com/profile/15081000575017515990noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-42503849508308239372012-05-22T05:42:48.830-04:002012-05-22T05:42:48.830-04:00Thanks you Disha.Thanks you Disha.saiju mathew stephenhttps://www.blogger.com/profile/05854921460168588274noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-22144777170722728122011-08-25T12:19:37.122-04:002011-08-25T12:19:37.122-04:00Hi Disha,
I have similar situation, where I need ...Hi Disha,<br /><br />I have similar situation, where I need to take attachments from user in itemadding eventhandler and add it to list item.<br /><br />I already raised my issue in this link, but I didn't get any useful information, if you have any ideas, plz let me know.<br /><br />http://social.msdn.microsoft.com/Forums/en-AU/sharepointdevelopment/thread/acbd19a3-368b-4ad4-ac2f-5211fc89bb93<br /><br />Thank you,<br />KishoreKishorehttps://www.blogger.com/profile/00600352253718445583noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-86586672480285060522011-05-23T11:25:33.441-04:002011-05-23T11:25:33.441-04:00Hi Disha,
I am uploading doucment using object mod...Hi Disha,<br />I am uploading doucment using object model. However my 'UploadFile()' method throws exception "The request failed with HTTP status 403: Forbidden.".<br />This happens if my current user is not a member of one custom group (ABCGroup). And 'ABCGroup' has all permissions. Even if I give 'Full Control' permissions to this user it doesn't work. So I am really wondering 1. Exactly which permission do we required to upload document into document library. and 2. Is it something wrong into my 'Uploadfile' method.<br /><br />--------- Here is code -------------<br />public string UploadFile(string workspace, string fileName, byte[] data, string title, string comment)<br /> {<br /> string retval = "";<br /><br /> SPWeb web = SPContext.Current.Web; <br /><br /> SPFile newFile;<br /> try<br /> {<br /> SPFolder spfolder = web.GetFolder(workspace);<br /><br /> if (spfolder != null)<br /> {<br /> if (data.Length == 0)<br /> {<br /> System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();<br /> data = encoding.GetBytes(" ");<br /> }<br /><br /> try<br /> {<br /> SPFile file = spfolder.Files[fileName];<br /><br /> if (file != null)<br /> {<br /> if (file.CheckOutStatus != SPFile.SPCheckOutStatus.None)<br /> {<br /> file.UndoCheckOut();<br /> }<br /> }<br /> }<br /> catch (Exception e)<br /> {<br /> retval = e.Message;<br /> }<br /><br /> newFile = spfolder.Files.Add(spfolder.Url + "/" + fileName, data, true, comment, false);<br /> newFile.Item["Title"] = title;<br /> newFile.Item.UpdateOverwriteVersion();<br /> newFile.CheckOut();<br /> newFile.CheckIn(comment, SPCheckinType.OverwriteCheckIn);<br /><br /> }<br /><br /> retval = "Uploaded successfully.";<br /> }<br /> catch (Exception e)<br /> {<br /> retval = e.Message;<br /> }<br /> return retval;<br /> }<br /><br />Thanks,<br />SandipAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-48311968159058377852011-04-26T09:14:41.189-04:002011-04-26T09:14:41.189-04:00Hi there,
I was hoping you could point me in the ...Hi there, <br />I was hoping you could point me in the right direction.<br />I am moving a list with attachments to a library. I was able to extract the attachments, get them all in a flat view and can move them over to library. BUT the title field in the list is not the title of the document. Is there a way I can get the title of the document to show up as a column so I can match up metadata with attachment in the library??<br /><br />SP2007<br />thanks!<br />JessicaJesshttps://www.blogger.com/profile/11655962640869255564noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-59895627752895556592011-01-15T23:51:02.690-05:002011-01-15T23:51:02.690-05:00Hi Disha,
1)In btnUpload_Click() method,below lin...Hi Disha,<br /><br />1)In btnUpload_Click() method,below lines<br />string tempFolder = Environment.GetEnvironmentVariable("TEMP");<br />string _filepath = tempFolder + _newfilePath;<br />FileUpload.PostedFile.SaveAs(_filepath);<br /><br />get the attachment from local drive & save it in temp folder.<br /><br />Help me in tweaking the above lines,if the user is uploading files from his machine which doesn't has MOSS installed.<br /><br />2)Also for adding the attachment in datagrid, this line: dt = (DataTable)ViewState["Files"];<br />will consume lots of memory & will slow the process of upload.<br /><br />Need help for tweaking the above points..<br /><br />Regards,<br />SidharthaUnknownhttps://www.blogger.com/profile/04302428748746858076noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-13634461600174959282011-01-15T20:36:05.403-05:002011-01-15T20:36:05.403-05:00Hi Disha,
Seeing your btnUpload_Click(), the belo...Hi Disha,<br /><br />Seeing your btnUpload_Click(), the below lines of code:<br />string tempFolder = Environment.GetEnvironmentVariable("TEMP");<br />string _filepath = tempFolder + _newfilePath;<br />FileUpload.PostedFile.SaveAs(_filepath);<br /><br />will surely give error as access denied... I agree with you on runwithelevated stuff.. But at the first instant if the above logic needs to be executed from machine which doesn't has MOSS installed then we are running into problem.<br /><br />Also in the method AddRow() this line:<br />dt = (DataTable)ViewState["Files"];<br />consumes to much memory do we have any alternatives....<br /><br />Was just going through the blog, looks good & explainatory... Can you help me with the above tweaks if possible..Unknownhttps://www.blogger.com/profile/04302428748746858076noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-10893955035558029502011-01-11T09:05:28.062-05:002011-01-11T09:05:28.062-05:00hi disha
I have requirement like uploading multip...hi disha <br />I have requirement like uploading multiple files at one go in sharepoint i have done single file upload control using file upload control in sharepoint plz share some code for uploading multiple files in sharepoint using the fileupload controlnagarajhttps://www.blogger.com/profile/04474210219258074867noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-73530532090891395802011-01-03T06:59:59.060-05:002011-01-03T06:59:59.060-05:00thnxs for the valuable inputthnxs for the valuable inputnagarajhttps://www.blogger.com/profile/04474210219258074867noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-27968827457173015152010-12-30T10:55:46.342-05:002010-12-30T10:55:46.342-05:00Nagraj
Definetly you can do that.
1> You can ...Nagraj<br /><br />Definetly you can do that.<br /><br />1> You can always change Database Server Name and Database Name when you create a new Sharepoint Site.But the best practise is always create site on the same SQL Server Instance where your configuratation datbase resides.<br /><br />2> When you configure the SharePoint it always asks what is your database server name and you can do at that time so it becomes by default .<br /><br />Hope this helps!!!<br />Disha ShahDisha shahhttps://www.blogger.com/profile/02518044206110358922noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-35260075774403560592010-12-29T02:15:06.485-05:002010-12-29T02:15:06.485-05:00thnxs disha
i have one more querry i want to have...thnxs disha<br /><br />i have one more querry i want to have dedicated sql server for sharepoint web application creation while creating web application from the central admin it always take the stand alone server with sql server instance i dont want the default server instance how to achieve this one ? i need to give the external sql server instance for creation of web application in sharepoint is it possible? if yes please share your thoughtsnagarajhttps://www.blogger.com/profile/04474210219258074867noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-677084451184713492010-12-28T10:00:03.933-05:002010-12-28T10:00:03.933-05:00Hi Nagraj
The problem could be different timezone...Hi Nagraj<br /><br />The problem could be different timezone. Please check the SharePoint Server Timezone and if it is not for UK, Please follow these steps to update a new timezone.<br /><br />1> Open your web browser and access your SharePoint site. <br />2> Click your Site Settings link. Under the Site Administrations section, you will find the "Regional Settings", click on that.<br />3> In the "Time Zone" section change time zone to the one you want <br />4> Click the "OK" button to apply the changes <br /><br />Let me know whether it solves your problem or not.<br /><br />Disha ShahDisha shahhttps://www.blogger.com/profile/02518044206110358922noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-80933613252208914602010-12-28T00:45:44.162-05:002010-12-28T00:45:44.162-05:00This comment has been removed by the author.nagarajhttps://www.blogger.com/profile/04474210219258074867noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-85797618449588509992010-12-01T09:33:10.843-05:002010-12-01T09:33:10.843-05:00Hi Nagrag
sorry for late reply!!!
yes you need t...Hi Nagrag<br /><br />sorry for late reply!!!<br /><br />yes you need to follow these steps<br />1> you need to fetch the emailid as column <br />2> you need to use string array and break column value with ,<br />3> Send email <br />If you still not achived please let me know<br /><br />Thanks<br />Disha ShahDisha shahhttps://www.blogger.com/profile/02518044206110358922noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-23489956705465399532010-11-11T02:04:21.844-05:002010-11-11T02:04:21.844-05:00Hi Disha
I have link list and i have folder inside...Hi Disha<br />I have link list and i have folder inside the link list whenever new item is added inside the folder i need to send mail how to achieve this !<br />through event handler i need to do !<br />But in the link list have column called Email which is having comma seperated mailid i need to pick those mailid and send mail whenever neew item is addednagarajhttps://www.blogger.com/profile/04474210219258074867noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-63233212888468220312009-10-07T02:32:14.000-04:002009-10-07T02:32:14.000-04:00Hi DishaThis post is good. I'm also working in...Hi Disha<br><br>This post is good. I'm also working in Sharepoint , I have a requiremnet, we have a webpart for slide show, this webpart takes images from an image list and shows them, now to use this webpart you need to 1> Upload all the images in the image list 2> Select the image list name from the Modify shared webpart dialouge ( we have customized it),we need to develop a sharepoint picker, from which users can upload docs to the list .<br><br>Can you help in this regard.<br><br>Thanks<br>ArindamArindam Cnoreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-21087525092678273112009-10-08T02:08:37.000-04:002009-10-08T02:08:37.000-04:00Hey Arindam,Thank you very much for your comment.P...Hey Arindam,<br><br>Thank you very much for your comment.<br><br>Please let me summarize here to see whether I am following you correctly or not for your requirements, you are saying that you need to develop functionality (SharePoint picker type of thing) from which user can upload documents to your list, and this has to be in your web part only, please correct me if I am wrong here…<br><br>If that’s your case then you can put ASP: File Upload control into your web part and write code on clicking of save button, which will take posted file name and upload same file into document library with the help of SPFile and other classes from SharePoint object model.<br><br>If you are looking for something else then please let me know.<br><br>Thanks,<br>Disha Shahdishashah08noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-44641761355181161272009-10-26T12:42:09.000-04:002009-10-26T12:42:09.000-04:00Hi Disha,I am very new to Sharepoint and ASP. I&#...Hi Disha,<br><br>I am very new to Sharepoint and ASP. I'm stuck and am looking all over the net for some help. I am using a Survey web part (I'm assuming it is a webpart that came with Sharepoint vs a web part someone in my organization created). I need functionality that allows the responder to upload an attachment to their survey response. Do you think your code will work in my case by adding it to the form "HEAD"? Or do you think I will need to use the ASP File Upload option? <br><br>If so, I'm certain I will be able to Google it and find something, but if you have first hand experience, I would love to know your approach with specific code samples.<br><br>Thanks in advance.Carlanoreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-81961600015596465402009-10-27T09:34:35.000-04:002009-10-27T09:34:35.000-04:00Carla, Thanks for the comments. Survey list is a s...Carla, <br><br>Thanks for the comments. <br><br>Survey list is a special type of list, which has limited type of features into it, like we cant add custom columns or manages content type, attach files etc. <br><br>So I prefer to develop Custom field Type. I have developed custom field type which asks from user for country and from country it displays related state names. You can also do same thing, you can create a custom field type which asks from user to upload a document and it uploads that file to document library and stores that path as your field value and then add a new question to survey list which has type of your custom list and you can name it like "Attachment". <br><br>This is the one way. Second way would be to create a new custom list which is not type of survey but try to make custom list same like Survey list. This is easiest way :) <br><br>Hope it will help to you.Thanks, <br><br>Disha Shahdishashah08noreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-67287660764031877272009-11-02T02:24:02.000-05:002009-11-02T02:24:02.000-05:00Dear Disha,Thank you for this great post.I want to...Dear Disha,<br>Thank you for this great post.<br>I want to ask you abour the variable "txtFileName", what is it and how can I get it?Nesreennoreply@blogger.comtag:blogger.com,1999:blog-6241523649263677429.post-43139139863720183262009-11-02T08:58:29.000-05:002009-11-02T08:58:29.000-05:00Hello Nesreen “txtFileName” is the Textbox that I ...Hello Nesreen<br> “txtFileName” is the Textbox that I have taken for providing the functionality to user, they can provide their own filename into “txtFileName” textbox.<br><br>It means whatever file you have selected by File Upload Control it replaces that filename with name entered into txtFilename textbox.<br><br>Example: <br>You have selected "test.txt" from File upload control , but you want to upload that file with different name say "Real.txt" , so you need to specify "Real" in that txtFilename text box<br><br> Hope this helps!!!<br><br> Thanks and Regards<br>Disha Shahdishashah08noreply@blogger.com